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

registry.yarnpkg.com responds with 503 error code quite frequently #7996

Open
kaiyoma opened this issue Mar 17, 2020 · 3 comments
Open

registry.yarnpkg.com responds with 503 error code quite frequently #7996

kaiyoma opened this issue Mar 17, 2020 · 3 comments

Comments

@kaiyoma
Copy link

kaiyoma commented Mar 17, 2020

Bug description

Lately, I've been noticing that yarn audit fails quite often with a 503 error code from the upstream server. It seems to be random: running the command over and over sometimes works, sometimes fails.

Command

yarn audit

What is the current behavior?
If I run with the verbose flag turned on, I see this:

verbose 2.2718308 Performing "POST" request to "https://registry.yarnpkg.com/-/npm/v1/security/audits".
verbose 15.5936641 Request "https://registry.yarnpkg.com/-/npm/v1/security/audits" finished with status code 503.
C:\Program Files (x86)\Yarn\lib\cli.js:66073
            throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.
statusCode);
            ^

ResponseError: Request failed "503 Service Unavailable"

What is the expected behavior?
No errors.

Environment

  • Node Version: 12.16.1
  • Yarn v1 Version: 1.22.4
  • OS and version: Windows 10 and Linux
@jakejarvis
Copy link

Just happened to run into this running npm audit as well, for what it's worth.

npm ERR! code ENOAUDIT
npm ERR! audit Your configured registry (https://registry.npmjs.org/) may not support audit requests, or the audit endpoint may be temporarily unavailable.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jake/.npm/_logs/2020-03-17T18_09_56_254Z-debug.log

Shows registry.npmjs.org also returns 503 in the verbose logs, so this might be NPM's fault:

5 http fetch POST 503 https://registry.npmjs.org/-/npm/v1/security/audits 13190ms

@kaiyoma
Copy link
Author

kaiyoma commented May 4, 2020

Seeing this again a lot right now. yarn audit is failing more than half the time with a 503 error.

@waterkip
Copy link

waterkip commented May 7, 2020

I have the same issue, but I'd like to add something to it in regards to the exit code. I don't mind the 503 (well I do), but I'm trying to do audit as part of a build process. I don't mind INFO or LOW, so I check if the return code is greater than 3 and continue. Because the 503 generates a return code of 1 my audit seems to complete just fine, as it is an "INFO".

Could you for the sake of scripting use a different exit code when a 503 enters? There is some kind of standard re exitcodes: http://www.tldp.org/LDP/abs/html/exitcodes.html, so I would propose 64.

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