Skip to content

Incorrect Header Check error downloading file #268

Description

@rahulserver

I get this error when trying to download file using this code in amazon-sp-api v1.0.4:

 let sellingPartner = new SellingPartnerAPI(this.configOptions);
      let res = await sellingPartner.callAPI({
        api_path: `/reports/2020-09-04/documents/${args.documentId}`,
        method: 'GET'
      });
      let report = await sellingPartner.download(res, {
        json: true
      });
Error: incorrect header check
    at genericNodeError (node:internal/errors:956:15)
    at wrappedFn (node:internal/errors:510:14)
    at Zlib.zlibOnError [as onerror] (node:zlib:189:17)
    at Zlib.callbackTrampoline (node:internal/async_hooks:130:17) {
  errno: -3,
  code: 'Z_DATA_ERROR'
}

This only seems to occur for some of the documentIds. To be specific, for this document id I got above error:

amzn1.spdoc.1.4.na.2b611da1-4893-46e2-8f82-5bbc9ed207d1.T3CEV4LAOA16EL.18200

Why is it happening and how do I fix it?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions