javascript icon indicating copy to clipboard operation
javascript copied to clipboard

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

Open bodycombathuang opened this issue 1 year ago • 6 comments

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

bodycombathuang avatar Jan 16 '24 15:01 bodycombathuang

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 avatar Jan 16 '24 16:01 brendandburns

There's also this PR that may help:

https://github.com/kubernetes-client/javascript/pull/1396

brendandburns avatar Jan 16 '24 16:01 brendandburns

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 avatar Jan 16 '24 16:01 bodycombathuang

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

bodycombathuang avatar Jan 16 '24 16:01 bodycombathuang

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-triage-robot avatar Apr 15 '24 17:04 k8s-triage-robot

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/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 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

k8s-triage-robot avatar May 15 '24 18:05 k8s-triage-robot

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/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:

  • 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 avatar Jun 14 '24 18:06 k8s-triage-robot

@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/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:

  • 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.

k8s-ci-robot avatar Jun 14 '24 18:06 k8s-ci-robot