Yarn: Handle server errors of registry.yarnpkg.com

Created on 18 Oct 2016  ·  14Comments  ·  Source: yarnpkg/yarn

Do you want to request a _feature_ or report a _bug_?
Bug

What is the current behavior?
Yarn outputs “An unexpected error occured [...]” if registry.yarnpng.com is down. And then the trace in yarn-error.log says (in my case) Error: https://registry.yarnpkg.com/react-dates/-/react-dates-3.3.3.tgz: invalid tar file.

If the current behavior is a bug, please provide the steps to reproduce.
I guess something like yarn install or yarn upgrade when the registry server is down would reproduce it.

What is the expected behavior?
The problem is not with the .tgz file, actually there's no .tgz file at all. Here right now https://registry.yarnpkg.com/react-dates/-/react-dates-3.3.3.tgz is responding with 504 Gateway time-out:
captura de tela de 2016-10-18 17-07-08

So I guess Yarn should handle 50x responses from registry and don't suggest the user please open a bug report with the information provided in "[...]/yarn-error.log".

Please mention your node.js, yarn and operating system version.
NodeJS: v6.8.1
Yarn: v0.16.0
OS: Arch Linux

Most helpful comment

I've been seeing a lot of these issues lately (502 errors) while building on travis. Its a drag.

All 14 comments

Just had a similar occurrence at roughly 2017-02-07 20:56:52 UTC on Linux w/Node v7.5.0.

yarn install v0.19.1
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/entities/-/entities-1.0.0.tgz: Request failed \"502 Bad Gateway\"".
info If you think this is a bug, please open a bug report with the information provided in "[...]/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

I've been seeing a lot of these issues lately (502 errors) while building on travis. Its a drag.

me too!!!

Same issues as well

Same issue with Travis here.

Same here!

same issue here

Having this issue today

I am seeing this right now too but it doesn't appear to be global. My CI in AWS us-west-2 (oregon) is failing but here in Australia the same URL is working. 🤷‍♂

I am using azure devops, and still failing at the moment.

me too using google GCE europe-west1
but seems random on any random package.

Seems to be fixed (for now).

seems fixed for me as well (for now) xD.

thanks all the people that shared the problem to understand that was a global issue.

Going to close for now. If you see 5xx's again, please comment here or open a new issue.

Was this page helpful?
0 / 5 - 0 ratings