Webhook triggers with gzip does not work in version 1.4.1

Hi,
I’m currently using webhooks to receive responses from some APIs.
The APIs work in HTTP POST method and they return JSON compressed in Gzip as response.

The last week I’ve updated N8N to 1.4.1, which is the latest version for docker, and the API no longer works today.
The error that server returns is (I can see this error into the API backend);
{"code":422,"message":"Failed to parse request body","hint":"Unexpected token \u001f in JSON at position 0"}"}

N8N seems to read the response as JSON, instead of Gzip.

The problem is that no execution is performed, so no workaround is possible.

I had to downgrade to 1.1.10 so that everything would work again.

Information on your n8n setup

  • **n8n version: 1.4.1 (latest) Running n8n via Docker,
  • **Operating system: Ubuntu

Hi @Mino_Bedin, I am very sorry you are having trouble.

I just gave this a go on a local n8n instance running [email protected]. via docker and using the below webhook node:

I was the sending a gzipped JSON file like so:

curl --request POST \
  --url http://localhost:5678/webhook-test/1c04b027-39d2-491a-a9c6-194289fe400c \
  --header 'Content-Type: application/gzip' \
  --data H4sICCot92QAA3Rlc3QuanNvbgCr5lIAAqXcSt/U4uLE9FQlKwWltPx8Ja5aLgDTqOvxGwAAAA==

The data arrives as expected in n8n:

Perhaps you can share your webhook node and also the exact request you are sending to n8n causing the problem you have reported?

Hi @MutedJam ,
since I am using an external API, I had to retrive the weebhook request using an external listener tool.

There what the tool is receiving: Webhook.site - Test, process and transform emails and HTTP requests

Could it be helpful?

Thanks

I am afraid I’m not quite sure what to make of this. Which tool exactly are you using to send these webhook requests?

Hi @MutedJam,
we are using this service API: dataforseo.com. Since before the n8n version update everything works fine, I am quite sure that the issue concerns the reception of data by the n8n and not the sending.
I am also quite sure there is something related to content-type and content-encoding parameters.

The API send to webhook a JSON compressed by GZIP, so the content-type of the webhook is “application/json” and the content-encoding is “gzip” (which is different from your example).

I found the way to reproduce the error, test 1 and test 3 reproduce exactly the way the API send the data (and the same error or success)

TEST 1 : N8N V1.1.1
On my mac terminal I execute this command:
echo '{"key": "value"}' | gzip | curl -X POST -H "Content-Type: application/json" -H "Content-Encoding: gzip" --data-binary @- https://mydomain.com/webhook-test/58976b87-4b24-481a-81cb-0f2f5bf01f6c

The workflow started and I can get the value {“key”: “value”} from the node

TEST 2 : N8N V1.1.1
echo '{"key": "value"}' | gzip | curl -X POST -H "Content-Type: application/gzip" -H "Content-Encoding: gzip" --data-binary @- https://mydomain.com/webhook-test/58976b87-4b24-481a-81cb-0f2f5bf01f6c

The workflow started, but I cannot get the value {“key”: “value”} from the node. The node return only empty parameters.

TEST 3 : N8N V1.7.1
echo '{"key": "value"}' | gzip | curl -X POST -H "Content-Type: application/json" -H "Content-Encoding: gzip" --data-binary @- https://mydomain.com/webhook-test/58976b87-4b24-481a-81cb-0f2f5bf01f6c

The workflow does not start, the terminal respond with this error {"code":422,"message":"Failed to parse request body","hint":"Unexpected token \u001f in JSON at position 0"}**%**

TEST 4 : N8N V1.7.1
echo '{"key": "value"}' | gzip | curl -X POST -H "Content-Type: application/gzip" -H "Content-Encoding: gzip" --data-binary @- https://mydomain.com/webhook-test/58976b87-4b24-481a-81cb-0f2f5bf01f6c

The workflow started, but I cannot get the value {“key”: “value”} from the node. The node return only empty parameters.

1 Like

Thanks a million for sharing these details @Mino_Bedin!

I was able to reproduce the problem and have added this to our backlog for a closer look and fix by the engineering team.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.