Skip to content
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

Frequent fetch() errors #458

Open
xconverge opened this issue Apr 15, 2024 · 7 comments
Open

Frequent fetch() errors #458

xconverge opened this issue Apr 15, 2024 · 7 comments

Comments

@xconverge
Copy link

xconverge commented Apr 15, 2024

I am encountering this a LOT intermittently during CI for my projects. I can rerun CI and then it is all fine. I have looked at the troubleshooting referenced but I am not behind a proxy so am not really sure what else it could be. My suspicion is some sort of load oriented timeout or npm rate limiting per IP. It could be intermittent internet too, but without seeing the reason for the exception it is hard for me to debug effectively what is happening

Internal Error: Error when performing the request to https://registry.npmjs.org/yarn; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at fetch (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22882:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchAsJson (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22896:20)
    at async fetchLatestStableVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22948:20)
    at async fetchLatestStableVersion2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22971:14)
    at async Engine.getDefaultVersion (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:23349:25)
    at async executePackageManagerRequest (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24207:28)
    at async BinaryCommand.validateAndExecute (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:21173:22)
    at async _Cli.run (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:22148:18)
    at async Object.runMain (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:24279:12)

I see there is some data in the throw here:

throw new Error(
`Error when performing the request to ${input}; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting`,
{cause: error},
);

Is there a way for me to see the contents of this easily, I am not sure where it ends up. If not (I doubt this will be the answer) could we perhaps move the err to the text instead?

@xconverge
Copy link
Author

So far I have tried:

  1. Changing from ISP provided DNS server to cloudflare or google DNS on the server
  2. export NODE_OPTIONS="--dns-result-order=ipv4first --no-network-family-autoselection"

With no change in behavior

Not sure I have any other knobs to turn on my end...

I will update to the latest https://github.com/nodejs/corepack/releases/tag/v0.27.0 and see if that helps, there are a few optimizations there that might help ( fix: download fewer metadata from npm registry #436 )

@xconverge
Copy link
Author

I still experience this issue with the newly released 0.27.0

@xconverge
Copy link
Author

xconverge commented Apr 19, 2024

I will be reverting to 0.24.0 (pre fetch() being used) for the time being :/

I wish I knew which one of these it was (probably?), but potentially if there was a way to set some of these timeouts that would be great....
https://undici.nodejs.org/#/docs/api/Errors?id=errors

@merceyz
Copy link
Member

merceyz commented Apr 20, 2024

#430 should start printing the cause property of that error so if you can re-test once that is released then that should provide the missing information.

@xconverge
Copy link
Author

Give me a few days to get back to you. I have been running 0.28.0 a lot to try and get the reason/cause and havent seen the issue at all since....

I will give it a few days and then I will step it back to 0.27.0 (would be wild if this made a difference looking at just the change related to clipanion.,...) or 0.26.0 just to confirm that the issue is still reproducible-ish on my setup. There is also a chance it was ISP related and is no longer a problem for me?

Just wanted to confirm that I am on it to followup, but it will take some time to be deterministic/conclusive, but as of now on 0.28.0, things are looking better unfortunately? 😆

@xconverge
Copy link
Author

Don't really know what to make of it, I haven't had an issue since my previous posts. I switched to 0.27.0 for a bit and still didn't have an issue. This will just have to remain a mystery until someone else encounters issues and we now see the cause. For now I will stay on 0.28.0 or the latest and report back if anything ever happens

@guyca
Copy link

guyca commented May 10, 2024

FWIW I encountered this issue while executing GitHub actions on Node 16. Switching to Node 18 has resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants