-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Z_BUF_ERROR - unexpected end of file #600
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
Comments
Yep, I have this as well. Maybe limiting unpack concurrency would help?!
This seems to happen only on projects with a lot of deps
…On Fri, Feb 3, 2017, 13:13 Vaughan Rouesnel ***@***.***> wrote:
When I ran pnpm i I got this error. Then I re-ran it and i didn't get the
error. Just looking to know if this could be a pnpm error?
Reproducing would be very difficult.
pnpm version:
0.51.1
Code to reproduce the issue: Actual behavior:
/registry.npmjs.org/lodash/4.11.2/stage/package/fp"
30338 error pnpm:
err:
name: "Error"
message: "unexpected end of file"
code: "Z_BUF_ERROR"
stack: "Error: unexpected end of file\n at Zlib._handle.onerror (zlib.js:370:17)\n"
Additional information:
- node -v prints: 6.5.0
- Windows, OS X, or Linux?: macOS
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#600>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB1pmzYAe9qw_1GU_No-erbFXCKfin3xks5rYwvlgaJpZM4L2Nfh>
.
|
Yep this is a project with 200+ deps. |
Seems like this is because too many packages are being unpacked simultaneously. I added a limit fetch concurrency and it doesn't happen anymore. A PR will be ready today |
I believe this is fixed in 0.52.1. I cannot reproduce this anymore |
I experienced this again with 0.53.0 on Windows. Re-running once worked. Is there a configuration option for this. |
Currently hardcoded to 16 https://github.com/pnpm/pnpm/blob/master/src/api/install.ts#L213 |
Okay, I think it should be configurable if its still causing issues. I will see if I can reliably reproduce it and which value fixes it. |
ok, I'll make it configurable. Concurrency is a real big issue. |
And reduce the default value to 4 Ref #600
I reduced the concurrency to 4 in version 0.54.0 and you can set the value via the |
...and unpack tarballs one by one Close #600
Fixed in v0.58.0. |
I just saw this error again in There is also no indication of the package that caused it...
Also tried with: Is this the line where the extraction happens: https://github.com/zkochan/unpack-stream/blob/master/src/index.ts#L96 |
yes as far as I remember our initial idea was that it was caused by concurrency. I think |
So it seems the package that was failing was
So it seems the tar for
I think the only thing we need to do is show the file the failed to unzip, and tell the user to file a bug with the module. Actually, it works fine if I download the tar manually...
Copy
The corruption must happen in Ah so the downloader is configurable here: Okay so it must be a bug in Looks like the sizes are different:
So on Ubuntu 16 there is a partial download happening. I started getting |
I'm still seeing this error. Do you know if there was any progress on this being fixed. I think I remember that we need retry logic for packages that don't match their content length. |
Can confirm also still seeing this. Hack to overcome issue:
Then open chrome node inspector => Now go to My very first few hours of using I think a fairly simple solution is to at least just log the packages that failed in this run, and more advanced would be prompt the user to retry the failed packages. All in all though, the grey hairs were worth the ~5GB of precious /home space I saved just converting around 10 node_modules to pnpm. Can't wait to get r 8000 id of the rest. |
@mnzaki thanks for this thorough investigation! As far as I understand, the tarball is downloaded correctly. Otherwise, integrity check would fail and pnpm re-downloads the package in that case. If that is the case, we can put the unpack logic into a try/catch and retry unpacking on this error. |
Here's where we unpack the tarballs https://github.com/zkochan/unpack-stream/blob/master/src/index.ts#L88 |
I tried to reproduce the error today, and did some more digging across async calls, this seems to be the problematic code: https://github.com/pnpm/tarball-fetcher/blob/master/src/index.ts#L134 async function fetchFromRemoteTarball (
// ...
) {
try {
const index = await fetchFromLocalTarball(unpackTo, opts.cachedTarballLocation)
return index
} catch (err) {
if (err.code !== 'ENOENT') throw err
// ...
} The problem is execution gets to this point even though the packed.tgz file is clearly corrupted. It tries to To reproduce:
Note about corrupt files:
|
Quick FixChanging
to
"solves" the issue (it will just redownload the file). Though I suspect it goes deeper than that: why is t even at this point of execution if Also I would highly recommend a higher level exception handler (perhaps in |
This sounds good. I would additionally log a warning if the error is not ENOENT. Does this error only happen with warm cache? Because the usecase you describe uses a tarball from cache |
Well yes, a warm cache, with corrupted files. |
Would you like to contribute this fix? Otherwise, I can probably fix it today or tomorrow |
* add @pnpm/logger dependency * test: redownload incomplete cached tarballs * fix: don't die if cached tarball is corrupted related to pnpm/pnpm#600
The fix was published with v1.30.1 |
@zkochan I am facing same problem with version 2.0.0. Error: |
This is true - 5520 silly fetchPackageMetaData error for material-design-icons@^3.0.1 unexpected end of file 5523 verbose Darwin 16.7.0 I'm getting this again and again while npm install on home network. |
npm? This pnpm's repo. If you have issues with npm, look here: https://npm.community/ |
still facing this issue |
Please create a new issue with steps to reproduce |
Still happening |
This one is different. It happens in the self-installer. Please, create a
new issue
Robert Lowe <notifications@github.com> ezt írta (időpont: 2020. febr. 15.,
Szo 2:21):
… [image: Screen Shot 2020-02-14 at 3 48 52 PM]
<https://user-images.githubusercontent.com/601141/74566583-cf715100-4f41-11ea-9030-fa9502467f99.png>
Almost a consistent on/off pattern
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#600?email_source=notifications&email_token=AAOWTG6A4WI6IOCXXIFM7WDRC3743A5CNFSM4C6Y27Q2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEL2MTFA#issuecomment-586467732>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAOWTGZHC3M35QS2RPTHKBTRC3743ANCNFSM4C6Y27QQ>
.
|
Fixed with "npm cache clean --force' |
When I ran
pnpm i
I got this error. Then I re-ran it and i didn't get the error. Just looking to know if this could be a pnpm error?Reproducing would be very difficult.
pnpm version:
0.51.1
Code to reproduce the issue:
Actual behavior:
Additional information:
node -v
prints: 6.5.0The text was updated successfully, but these errors were encountered: