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

Incorrect Header Check error downloading file #268

Open
rahulserver opened this issue Jan 26, 2024 · 1 comment
Open

Incorrect Header Check error downloading file #268

rahulserver opened this issue Jan 26, 2024 · 1 comment

Comments

@rahulserver
Copy link

rahulserver commented Jan 26, 2024

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?

@rahulserver
Copy link
Author

rahulserver commented Jan 26, 2024

I downgraded my version to 0.7.10 and it works fine. So the issue seems to be only in latest version(and probably v1+)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant