ZlibError: zlib: unexpected end of file for cp.cpFromPod method
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
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?
There's also this PR that may help:
https://github.com/kubernetes-client/javascript/pull/1396
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
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
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/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas 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
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue as fresh with
/remove-lifecycle rotten - Close this issue with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.