TypeError: fetch failed

Open
#9 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
node.js
Domain
cli, networking

Research direction

Start at the CLI error-handling path that reports the failed fetch, then reproduce the package test with the reported command and a blocked or restricted network. Done means the failure produces a friendlier message and identifies the URLs or domains that could not be contacted, with coverage for the reported error case.

Written by the indexing model from the issue text.

Description

need more info

Hello, thank you for releasing this tool for free!

I followed the steps to install sfw and test for a malicious package from the blog post. I am seeing the below when trying to test any package. I am connected to a corporate VPN, so I assume something might be blocking the request, but maybe it would be good to have a friendlier error message and highlight what urls/domains could not be contacted so they can be whitelisted?

sfw npm install lodahs
Protected by Socket Firewall
⠴Socket Firewall encountered an unexpected error: TypeError: fetch failed
    at node:internal/deps/undici/undici:15422:13
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async /Users/runner/work/firewall/firewall/dist/sfw-free.js:25:62842
    at async Promise.all (index 0)
    at async ZC (/Users/runner/work/firewall/firewall/dist/sfw-free.js:27:75)
    at async Ev (/Users/runner/work/firewall/firewall/dist/sfw-free.js:43:46219)
    at async X2 (/Users/runner/work/firewall/firewall/dist/sfw-free.js:43:47011)
    at async jP (/Users/runner/work/firewall/firewall/dist/sfw-free.js:68:1055)
    at async Server.GP (/Users/runner/work/firewall/firewall/dist/sfw-free.js:77:970)
⠧
sfw -v                  
Socket Firewall Free, version 0.12.18
Dominant language
No language data
Stars
271
Forks
8
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from SocketDev/sfw-free

All issues in SocketDev/sfw-free

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.