Skip to content

Z_DATA_ERROR during push parsing #1040

@coopernetes

Description

@coopernetes

The following stack trace is observed when GitProxy is receiving a push. It's not clear what the cause of it is but it seems related to the parsing logic in parsePush step. The same error is hit multiple times in the process of a single push.

Error: incorrect header check
    at genericNodeError (node:internal/errors:984:15)
    at wrappedFn (node:internal/errors:538:14)
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
    at Zlib.callbackTrampoline (node:internal/async_hooks:130:17)
    at processChunkSync (node:zlib:415:12)
    at zlibBufferSync (node:zlib:178:12)
    at Object.syncBufferWrapper [as inflateSync] (node:zlib:767:14)
    at unpack (/app/src/proxy/processors/push-action/parsePush.js:234:25)
    at getContent (/app/src/proxy/processors/push-action/parsePush.js:212:35)
    at getContents (/app/src/proxy/processors/push-action/parsePush.js:145:37) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}

It seems to be mostly cosmetic as the remaining steps still proceed as expected. Parsing of the pushed data is only used for extracting certain metadata out of the payload for the purposes of checking out the remote repo, performing diffs against HEAD and base branches and other operations.

The receive pack from git usually contains "delta-fied"1 chunks of data and I suspect it is not actually zlib compressed hence this error message. We can likely rely solely on the first part of the payload which contains the following info:

  • tree + commit sha
  • parent + commit sha
  • author & committer names & email addresses
  • commit message
  • GPG signature

This is the expected payload which is successfully parsed even with these errors raised:

{
  x: {
    item: 0,
    value: 159,
    type: 1,
    size: 543,
    deflatedSize: 397,
    objectRef: null,
    content: 'tree {commit sha redacted}\n' +
      'parent {commit sha redacted}\n' +
      'author {redacted} 1747147000 -0400\n' +
      'committer Thomas Cooper <{redacted}> 1748440293 -0400\n' +
      'gpgsig -----BEGIN PGP SIGNATURE-----\n' +
      ' \n' +
      ' {redacted}\n' +
      ' {redacted}\n' +
      ' {redacted}\n' +
      ' {redacted}\n' +
      ' -----END PGP SIGNATURE-----\n' +
      '\n' +
      "{commit message}\n" +
      '\n' +
      'Signed-off-by: {commit sha redacted}\n'
  }
}

Footnotes

  1. https://github.com/git/git/blob/master/Documentation/gitprotocol-capabilities.adoc#ofs-delta

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinghelp wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions