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

Add a more useful error message when we cache a broken tarball #3355

Conversation

sandlerr
Copy link
Contributor

@sandlerr sandlerr commented May 9, 2017

Summary

It looks like there should be an error handler that reports English for the fetchErrorCorrupt string, but instead an error from tar-stream is being returned without the filename.

This makes it quite difficult to figure out which module is causing the error so that the bad tarball can be deleted.

Test plan

Running yarn upgrade <list_of_modules> with this code yielded the following results:

error An unexpected error occurred: "Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped? (/Users/rsandler/Code/zendesk/zendesk_console/npm-packages-offline-cache/detect-browser-1.7.0.tgz)".

Where previously the section in brackets was not there.
The cause appears to be yarn caching the npm registry's 404 response (which is HTML) to a file. Why it does that, and why the registry is returning 404 for extant modules is not clear to me.

It looks like there should be an error handler that reports the
`fetchErrorCorrupt` string, but instead an error from tar-stream
is being returned without the filename.
@bestander bestander merged commit 0f68486 into yarnpkg:master May 9, 2017
@sandlerr sandlerr deleted the roman/better-error-message-for-broken-tarball branch May 9, 2017 23:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants