npm / registry-issue-archive

An archive of the old npm registry issue tracker
https://npm.community
249 stars 47 forks source link

Fastly error? Various requests to registry returning 500 #339

Open marcdavi-es opened 6 years ago

marcdavi-es commented 6 years ago

Hi. I'm getting 500s back from the registry for any kind of request I make to the main registry.

Some examples:

My guess is there's a problem with your Fastly CDN. It's not clear why it persists (for more than a day now) for me whereas my colleagues on the same network have no problems...

I reported this in npm/npm but perhaps this is the right place.

Other people seem to be having similar problems (https://github.com/npm/npm/issues/20818, https://github.com/npm/npm/issues/20792) but the status is all green 🤷‍♂️


Update

Yeah it seems the problem is likely with your CDN. It seems to be hating on me personally 😂

I managed to get things working by going through the yarn mirror.

.npmrc

registry=https://registry.yarnpkg.com/
//registry.yarnpkg.com/:_authToken=....

A dirty hack but it helps me get back to work for now.


Update - solved

Thanks to the super helpful comment here I got past this.

pascollin commented 6 years ago

Same issue solved by forcing the registry.npmjs.org ip into hosts file. The current IP is 104.18.94.96, but my FAI dns gives 151.101.60.162 as its IP address.

omatrot commented 6 years ago

This is a DNS issue, I switched to google's DNS and now everything is fine.

khouse commented 6 years ago

Google DNS did not resolve my issue. I'm still getting consistent 503 errors

lappy486:~ khouse$ curl -I https://registry.npmjs.org
HTTP/1.1 503 No backends available
Date: Wed, 06 Jun 2018 15:18:57 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 28
Connection: keep-alive
Set-Cookie: __cfduid=dbc3850f0e72fb1ecc74365b4559315fd1528298324; expires=Thu, 06-Jun-19 15:18:44 GMT; path=/; domain=.registry.npmjs.org; HttpOnly
Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Server: cloudflare
CF-RAY: 426bda702da69afc-DFW
DavidAPowers commented 6 years ago

Possibly a similar issue, on Windows 10 from the command line.

npm set init.author.name "David Powers"
npm set init.author.email "cyborgk@gmail.com"
npm set init.author.url "http://www.davidapowers.tech"
npm adduser

FIRST TIME, I got the 500 error below, but SECOND TIME, the command was actually successful. So it appears to be an inconsistent failure.

npm ERR! code E500
npm ERR! Registry returned 500 for POST on https://registry.npmjs.org/-/v1/login

LOG:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\pad\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'adduser' ]
2 info using npm@6.1.0
3 info using node@v9.3.0
4 verbose config Skipping project config: C:\Users\pad/.npmrc. (matches userconfig)
5 verbose npm-session b7ce81b23923cfdf
6 verbose web login before first POST
7 http request → POST https://registry.npmjs.org/-/v1/login
8 http 500 ← Internal Server Error (https://registry.npmjs.org/-/v1/login)
9 verbose stack Error: Registry returned 500 for POST on https://registry.npmjs.org/-/v1/login
9 verbose stack     at fetch.defaults.catch.then.then.result (C:\Users\pad\AppData\Roaming\npm\node_modules\npm\node_modules\npm-profile\index.js:376:13)
9 verbose stack     at <anonymous>
9 verbose stack     at process._tickCallback (internal/process/next_tick.js:160:7)
10 verbose statusCode 500
11 verbose cwd C:\Users\pad
12 verbose Windows_NT 10.0.17134
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\pad\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "adduser"
14 verbose node v9.3.0
15 verbose npm  v6.1.0
16 error code E500
17 error Registry returned 500 for POST on https://registry.npmjs.org/-/v1/login
18 verbose exit [ 1, true ]