yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.39k stars 2.73k forks source link

403 error page from CloudFlare on https://registry.yarnpkg.com #5885

Closed schneidmaster closed 6 years ago

schneidmaster commented 6 years ago

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

yarn add <anything> returns 403, which makes sense because https://registry.yarnpkg.com shows an error from CloudFlare:

screenshot 2018-05-25 18 35 33

This article suggests it's caused by a DNS misconfiguration?

What is the expected behavior?

Package successfully installs.

Please mention your node.js, yarn and operating system version.

node 8.9, yarn 1.6, macOS 10.13.4 (though I doubt any of that is relevant 🙂)

melroy89 commented 6 years ago

You are not alone! Do not panic!

BirknerAlex commented 6 years ago

I got the same issue on my builds.

melroy89 commented 6 years ago

OK.. I'm panicking..

sandersky commented 6 years ago

It is worth noting the issue happens when trying to visit the npm registry and thus is probably not yarn's fault. http://registry.npmjs.com/

urish commented 6 years ago

Same here on Win 10 with Yarn 1.7.0.

Interestingly, I'm also getting the error for the npm registry page, as @sandersky noted, but npm install works perfectly whereas yarn fails for the very same project (and I do not have all the dependencies locally cached),

melroy89 commented 6 years ago

@sandersky No, it's Cloudflare fault. Sorry, it's npm fault they make changes in the registry which is pushed to Cloudflare, impacting yarn. https://status.npmjs.org/incidents/t3j62lxb7jg3

schneidmaster commented 6 years ago

@sandersky Interesting -- though npm is having a different issue (Error 1016 compared to 1014 for yarn). 1016 sounds like a more garden-variety DNS error (Cloudflare simply can't resolve the DNS hostname) while 1014 is an error about a DNS record pointing at a domain in a different Cloudflare account. I wonder if npm's issue is causing yarn's, or if Cloudflare threw the switch on something that broke both at the same time.

BirknerAlex commented 6 years ago

Maybe Cloudflare broke something, never deploy changes on a friday. 🍺

ktalebian commented 6 years ago

npm install works, but yarn install fails.

schneidmaster commented 6 years ago

@sandersky Oh, npm's registry lives at https://registry.npmjs.org (not .com). It seems to be working fine, which explains why everyone can npm install successfully.

ktalebian commented 6 years ago

https://status.yarnpkg.com/ is green; hopefully somebody from Yarn will get on top of this.

arunesh90 commented 6 years ago

According to https://status.npmjs.org/ npm is making changes to their registry. My guess is that one of those changes was moving to Cloudflare. And as Cloudflare doesn't allow CNAMEs that point to other domains that also make use of Cloudflare, I'm guessing that that's what happened here.

Possible solutions for this problem are

bradennapier commented 6 years ago

yarn ded :( - now my colleagues say "see - npm is the best option" and I lose all my hard work in making everyone use it :-P

heh - anyway - im sure you guys will figure it out

jzila commented 6 years ago

+1 on both dev machines and AWS CI machines.

jakwuh commented 6 years ago

The fun stuff is that I just switched to yarn because of npm issues (e.g. https://github.com/npm/npm/issues/20434) And 10 mins later yarn registry is failing. Lol 😄

ktalebian commented 6 years ago

@arunesh90 how do you make yarn use npmjs registry?

schneidmaster commented 6 years ago

npm confirmed that they are currently moving to CloudFlare (tweet). So it sounds like @arunesh90's explanation is the right one.

melroy89 commented 6 years ago

@jakwuh let's go back to PHP.. :rofl:

francocorreasosa commented 6 years ago

Getting 403s too 😭

ktalebian commented 6 years ago

To quote @alexbrazier never deploy on a Friday (or ever. You can't break anything if you don't change anything).

fathyb commented 6 years ago

As a temporary workaround you can config yarn to use the npm registry :

yarn config set registry "https://registry.npmjs.org"

Edit: @jaredLunde noted that it doesn't work with yarn install, use yarn install --no-lockfile

bradennapier commented 6 years ago

@fathyb MY HERO! <3

AviVahl commented 6 years ago

https://status.yarnpkg.com/ should probably reflect registry is down.

melroy89 commented 6 years ago

@avivahl npm was indeed testing if status.yarnpkg.com is working, whenever the registry is down. And it's not :upside_down_face:

BirknerAlex commented 6 years ago

It seems the yarn team has fixed the issue and added a http redirect to https://skimdb.npmjs.com/?

ktalebian commented 6 years ago

@BirknerAlex my installations are still failing.

BirknerAlex commented 6 years ago

Strange. If I open up the url I get redirected to the npm url on my workstation. But on my server it's still failing. Maybe a DNS caching issue.

jaredLunde commented 6 years ago

yarn config set registry "https://registry.npmjs.org"

For some reason this doesn't seem to work with yarn install. Only working w/ yarn add for me...

jzila commented 6 years ago

The workaround won't work if you have a yarn.lock file.

jaredLunde commented 6 years ago

@jzila yep that's it

jakwuh commented 6 years ago

@jzila yarn --no-lockfile

fathyb commented 6 years ago

~yarn install --force if you want to keep locked versions~ use yarn --no-lockfile

BirknerAlex commented 6 years ago

Now the hostname does not be resolved anymore for me.

curl https://registry.yarnpkg.com 
curl: (6) Could not resolve host: registry.yarnpkg.com

I give up and take a beer and try it later again :beer:

codymikol commented 6 years ago

Ahhh glad to see we aren't the only ones.

arunesh90 commented 6 years ago

Yarn's team is now aware of the issue and working on fixing it (https://twitter.com/arcanis/status/1000151453476978689)

isaacs commented 6 years ago

Hey, folks. https://github.com/yarnpkg/yarn/issues/5885#issuecomment-392209518

Probably you already know this, but just in case, if you're going to create an HTTP redirect (ie, 301 or 302 and a location: header), it should be to https://registry.npmjs.org, not http://skimdb.npmjs.com. SkimDB is the couchdb replication endpoint only, it doesn't have package tarballs.

cromatikap commented 6 years ago

lol it's the first time that I see an issue which concerns me in real time. Epic ! x)

reyou commented 6 years ago

We are all witnesses of an Black Yarnday! Wake up CloudFlare DevOps! You broke something.

I was just following jest tutorials and it blow up.

stewartpark commented 6 years ago

If you have a yarn.lock and don't want to delete it, you can temporarily do:

sed -i s/registry.yarnpkg.com/registry.npmjs.org/g yarn.lock
yarn
sed -i s/registry.npmjs.org/registry.yarnpkg.com/g yarn.lock
arcanis commented 6 years ago

Quick comment to mention that we're aware of the issue, and trying to figure out a solution.

@isaacs The error page from Cloudflare mentions that cross-user CNAME are possible for Pro, Business, and Enterprise users through a support ticket. By any chance, is it something you could do?

schneidmaster commented 6 years ago

npm's CTO is reaching out to CloudFlare about allowing the cross-user CNAME: tweet

ceejbot commented 6 years ago

We (aka npm) are in contact with Cloudflare to get this third-party CNAME allowed. I'll update this thread when I hear back.

Daniel15 commented 6 years ago

https://status.yarnpkg.com should probably reflect registry is down.

Sorry for the delay in updating this. It's been updated to reflect this issue. This status is also shown on every page on the Yarn site.

ceejbot commented 6 years ago

Our CF rep says their SRE team is on it now-- should see a fix soon!

cromatikap commented 6 years ago

yarn add echarts

ktalebian commented 6 years ago

https://registry.yarnpkg.com/ is now hard down!

codymikol commented 6 years ago

EDIT: I'm a jerk, the dependencies on the machine I'm testing must be cached. It still does not work on my CI

ceejbot commented 6 years ago

I'm in active conversation with Cloudflare about this; the fix is turning out to be more complicated than they expected because we're using edge workers. I'll continue to update here!

ktalebian commented 6 years ago

@codymikol is it? curl https://registry.yarnpkg.com/ times out

judge2020 commented 6 years ago

@miguelmota Cloudflare CNAME's aren't real CNAME's. CF sets A records and proxied traffic going through only acts as a CNAME.