Amazon Seller Central - GUNZIP Error

Good day.

The scenario is very basic - Create a report, download the report and gunzip it. The problem is that i get an error which doesn’t make sense! There’s nothing to this, right?

Thanks
RDC

Welcome to the Make community!

For the gunzip module, the data must already be GZIP archive in binary format (i.e. data)

“Incorrect headers” means the data is not a valid GZIP archive.

If you need further assistance,

1. Screenshots of module fields and filters

Please share screenshots of relevant module fields and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:
Screenshot_2023-10-07_111039

2. Scenario blueprint

Please export the scenario blueprint file to allow others to view the mappings and settings. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

Screenshot_2023-08-24_230826
(Note: Exporting your scenario will not include private information or keys to your connections)

Uploading it here will look like this:

blueprint.json (12.3 KB)

3. And most importantly, Output bundles

Please provide the output bundles of the modules by running the scenario, then click the white speech bubble on the top-right of each module, save the bundle contents in your text editor as a bundle.json file, and upload it here into this discussion thread.
Screenshot_2023-10-06_141025

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

3 Likes

Thank you for the response and the tips on how to compile a more comprehensive post.

Those were my thoughts exactly which means that Amazon Seller Central isn’t generating valid data (in binary format) and that the note in the Download Module is no longer valid. No idea how to download and convert their reports now :frowning:

The report:

The tip:

Oh well.

Hi @Ricardo_da_Costa ,

Maybe, you could use this module: deflate - never tested.

Hope it helps,

Philippe

3 Likes

Thanks Philippe but alas, both Inflate and Deflate don’t work. This is very unfortunate because imagine the power of being able to download the reports, push them to a database and then do some analysis.

Hi @Ricardo_da_Costa,

Could you give us the message you receive with the deflate module?
Did you try this template?

PBI

1 Like

Hi.

The template worked using the “Get Sales and Traffic Report” but it fails most of the other reports.

Always the same error message in the gunzip module.

With deflate. Fails on the JSON module.

Hi @Ricardo_da_Costa ,

I think that I have found something interesting here.
It seems that when you call the “Download a report document” module, there is a field in the output bundle indicating if a compression algorithm is used or not.

Could you add a screenshot of this output bundle?

Philippe

3 Likes

The Bundle just has binary data… The Download module only allows a person to enter in the Report ID.

Could you also add a screenshot of the output bundle of the “Create a Report” module?

In your last screenshot (sorry for being pushy), there is nothing under Report Document Data?

According to the Amazon documentation, this compression algorithm seems important.

2 Likes

Not pushy at all! Surprised you’re still trying to solve it :smiley:

There are no compression algorithm choices in the module. Only dates, so it defaults to GZIP.

Hi @Ricardo_da_Costa,

I was just thinking, this could be an encoding issue when downloading certain files.

I have mentioned a possible workaround for this here with some screenshots: Read text in .txt file stored in google drive - #4 by samliew

You can use a “Convert encoding” module using the same input and output encoding, then you can use the output of this module in your Parse JSON module. This should go in-between the GUNZIP and Parse JSON module.

Alternatively, you can simply try   toString(data)   in your Parse JSON module’s JSON field.

3 Likes

And in this one:


Could you fold the Report Document Data (nothing hidden underneath)?

For the reports producing an error, could you build another scenario without the Unzip step?
Maybe, they are pure JSON files.

3 Likes
  1. Nope. Nothing hidden. It’s just a binary output.

  2. Directly to JSON fails.

1 Like

You can submit a ticket to support, they have more investigation tools.

Or you could also use an API call, this way you will directly speak with Amazon Seller Central.

1 Like

Thanks… How would I log a Support Ticket? It’s more because the hints given in the module need to be updated to indicate that not all reports are in the gzip format.

Alas, I agree that I might have to use the API but I’m just testing the samliew’s suggestion first. Will let you know.

Update… I turfed the GUNZIP module and am using the Convert Encoding module. It outputs a single line text which is converted into a table if the header is ignored.

Thank you both for your help! It means so much.

4 Likes

Right, so the gzip/gunzip was an option, but was never actually used! :smiley:

1 Like

Nope. GUNZIP was used but it doesn’t work because it gives that Header error. It works with some reports but not most.

Your suggestion is the best.

1 Like