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

ZlibError: zlib: unexpected end of file for cp.cpFromPod method #1521

Open
bodycombathuang opened this issue Jan 16, 2024 · 5 comments
Open
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.

Comments

@bodycombathuang
Copy link

when I use cp.cpFromPod for a file with size about 6MB, I get error
c:\typescript\node_modules\minizlib\index.js:154
this[_onError](new ZlibError(err))
^
ZlibError: zlib: unexpected end of file
at Unzip.write (c:\typescript\node_modules\minizlib\index.js:154:22)
at Unzip.flush (c:\typescript\node_modules\minizlib\index.js:105:10)
at Unzip.end (c:\typescript\node_modules\minizlib\index.js:111:10)
at Unpack.end (c:\typescript\node_modules\tar\lib\parse.js:544:21)
at Pipe.end (c:\typescript\node_modules\fs-minipass\node_modules\minipass\index.js:75:17)
at ReadStream.[emitEnd2] (c:\typescript\node_modules\fs-minipass\node_modules\minipass\index.js:522:9)
at ReadStream.[emitEnd] (c:\typescript\node_modules\fs-minipass\node_modules\minipass\index.js:507:21)
at ReadStream.emit (c:\typescript\node_modules\fs-minipass\node_modules\minipass\index.js:458:27)
at ReadStream.emit (c:\typescript\node_modules\fs-minipass\index.js:175:22)
at ReadStream.[maybeEmitEnd] (c:\typescript\node_modules\fs-minipass\node_modules\minipass\index.js:440:12) {
code: 'Z_BUF_ERROR',
errno: -5,
recoverable: false,
file: 'C:\Users\zhhuan\AppData\Local\Temp/8a34ec6b-69f2-41f5-8026-af4c23168279',
cwd: 'c:/typescript/json',
tarCode: 'TAR_ABORT'
}

I used latest version

@brendandburns
Copy link
Contributor

I suspect that the network connection is getting interrupted, can you try to reproduce this locally with a minikube cluster where network isn't a problem?

@brendandburns
Copy link
Contributor

There's also this PR that may help:

#1396

@bodycombathuang
Copy link
Author

hi @brendandburns 1396 does not provide any workaround or solution
if the file size is small, (several bytes), I cannot reproduce, it is reproduced for file that is larger than 5MB each time

@bodycombathuang
Copy link
Author

https://github.com/kubernetes-client/javascript/blob/master/src/cp.ts
async ({ status }) => { writerStream.close(); if (status === 'Failure' || errStream.size()) { throw new Error(Error from cpFromPod - details: \n ${errStream.getContentsAsString()}); } await tar.x({ file: tmpFileName, cwd: tgtPath, }); },

i guess it is because tar.x command is executed before "tar zcf" command is finished

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

4 participants