-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Getting constant FetchError...reason: Socket timeout
when installing packages
#3078
Comments
FetchError...reason: Socket timeout
when installing packages
judging by the path in your issue, i'm guessing that you are using a custom registry and not the npm one? these socket timeouts seem like an issue with either your registry itself or the network connection between the computer you're installing packages on and your registry host. if you can, you might try installing some packages using the official npm registry just to see if you continue to have issues. if something like let us know what you find! |
Yeah, this is going through a custom Visual Studio registry. And it has been an issue on most of the machines from the team as well as the build pipelines. I can try to repro it with the npmjs registry, but it seems to only occur on bigger projects, since I didn't face the issue on a smaller one during testing. |
you might try experimenting with the |
So reducing might help with this issue? Is this because it might overloading it? |
yeah, that's what i'm thinking. potentially reducing the number of concurrent requests will give the registry a better chance at handling them. it could be reducing that number enough will avoid the timeouts entirely. it's certainly worth a try, anyway. |
Sounds good, let me play around with a couple different values, and I'll post any results. |
So I tried 10, 5, and 1 for maxsockets, and I was still getting the same timeout issues. |
interesting.. so we're left with trying to reproduce this against the npm registry, which as you mentioned is somewhat difficult. installing the do you have a proxy in use, by chance? i'm just trying to determine what else may be in the network between the computer doing the installation and the registry itself. |
@nlf this is a MSFT internal registry, we could get a on a Teams call and debug if that's helpful? |
So we followed up with the Azure Devops team in terms of our registry, to get an idea of whether that was causing an issue, and from their side, they aren't even seeing the timeout calls. So they believe it might be some logic in NPM that might be throwing a timeout for the wrong reason. |
so we're timing out requests that were never even actually sent? that's.. surprising, and strange. do you, by chance, use vsts-npm-auth? |
Yeah, I can share the fiddler trace if that helps. Most of the team does, but there are a couple people on the team that have Macs, so we set the .npmrc authentication manually. |
hmm, ok. and you already said the folks on macs are seeing this problem too, so we definitely can't point to vsts-npm-auth as a source of the problem.
i'll reach out to you in a higher bandwidth way either this afternoon or tomorrow morning (pacific timezone) so we can try to debug a bit more. |
Yeah, definitely seeing this issue as well on my Mac. Sounds good, I'm on Teams if that helps or whichever way is fine. |
We're seeing this same error with these versions:
The interesting thing is that it'll timeout within 4 seconds of a previous Is there any update on this issue or workarounds we should try? |
Update
|
did you find a solution? |
Something that could be related: npm/statusboard#442 (comment) |
You can reproduce the issue on slow unstable connections. |
Just a quick follow up on this. I was having a major issue trying to run Now I saw a Fetch error towards the end of running
Just to double check this file, I ran
NOTE: there is NO HTTP proxy involved on this network. Perhaps I should open a new issue. |
I have this issue when cloning a github repo. Network speed and connection should be fine... Windows 11, npm 8.13.2, node 18.6.0 (as well as v16.16.0).
|
Downgrading to Node v14.20.0 apparently fixes the issue. |
Verifique o antivirus, e desabilitar a proteção das portas: |
For me, the issue was resolved by reducing the default was |
I can confirm this is reproducible on unstable network connections with npm I suggest @nlf and @npm team to reopen and set-up a test within network throttling in attempt to reproduce. Reducing maxsockets with Please let me know if I can help debugging/reproducing this. |
+1 to seeing this behaviour frequently in a docker environment |
Im seeing this same timeout error. However, I've noticed that it only happens on my home wifi. If I use my iPhone's hotspot everything works blazingly fast. I don't have any proxies set and I have reset my home wifi. This also happens on my work Mac too. Home wifi === npm timout errors. Hotspot === fine. I'm running Node v 20.0.0 and npm 9.6.4. here's the output of my --loglevel verbose:
|
I have the same issue as @rolias4031 described: Socket connection timeout on the home network but no problems with a hotspot. I updated npm and node to the latest version using nvm. Here's the error log:
|
Hey @tobiaswendling this turned out to purely be a network issue for me. Using a VPN also solves the problem, and the issue went away within a few days. I use Spectrum and live in TX, USA if that helps. I've also found Reddit threads unrelated to development/npm that talk about odd spectrum blockages. |
I had the same issues described above, and once I switched on one of my VPN clients, the issue went away. |
I've been using 8.8.8.8 when I've encountered this issue but I was able to successfully update when using 1.1.1.1 |
In my case the problem was solved by increasing the RAM. |
Current Behavior:
When trying to install packages, without a previous cache, we get constant timeouts when trying to fetch packages, both locally and in a CI environment. The package that fails is always different, so there isn't a specific package causing the issue.
Stack trace:
Tried using the fetch-retries, fetch-retry-mintimeout, and fetch-retry-maxtimeout options, but didn't seem to have any effect.
Expected Behavior:
Install packages without timing out.
Steps To Reproduce:
Using a project with workspaces (~6425 packages)
No cache available
Run
npm ci
Environment:
OS: Mac OS 11.2.3 or Windows 10
Node: 14.15.4
npm: 7.9.0
The text was updated successfully, but these errors were encountered: