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

504 Gateway Timeout #10728

Closed
suneetk92 opened this issue Sep 7, 2024 · 19 comments · Fixed by #10781
Closed

504 Gateway Timeout #10728

suneetk92 opened this issue Sep 7, 2024 · 19 comments · Fixed by #10781
Labels
in linear Issue or PR has been created in Linear for internal review

Comments

@suneetk92
Copy link

suneetk92 commented Sep 7, 2024

Bug Description

Webhook + Respond to Webhook is resulting in 504 Gateway Timeout with the latest n8n version >=1.57.0

The same workflow is working fine till 1.56.2

To Reproduce

{
  "meta": {
    "instanceId": "3bbb5eb527440d285b702982482fddd9fbd528aa6711cb410dfb9d10eb9f60cc"
  },
  "nodes": [
    {
      "parameters": {
        "respondWith": "json",
        "options": {
          "responseCode": 200
        }
      },
      "id": "28658438-e29c-499a-94af-f04e0403fefa",
      "name": "Respond to Webhook",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        820,
        860
      ]
    },
    {
      "parameters": {
        "path": "7b30ca2d-db12-43e5-88dd-1145363c148f",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "2395cdf7-6a62-4a0a-bd52-56cf3b2fb41f",
      "name": "Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        600,
        860
      ],
      "webhookId": "7b30ca2d-db12-43e5-88dd-1145363c148f"
    }
  ],
  "connections": {
    "Webhook": {
      "main": [
        [
          {
            "node": "Respond to Webhook",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "pinData": {}
}

Expected behavior

Webhook + Respond to Webhook should work same as in 1.56.2

Operating System

Alpine Linux v3.20.1 (docker)

n8n Version

=1.57.0

Node.js Version

v20.15.0

Database

PostgreSQL

Execution mode

queue (1 master + 3 workers + 3 webhook nodes)

@Joffcom
Copy link
Member

Joffcom commented Sep 7, 2024

Hey @suneetk92,

We have created an internal ticket to look into this which we will be tracking as "GHC-212"

@Joffcom Joffcom added the in linear Issue or PR has been created in Linear for internal review label Sep 7, 2024
@luizeof
Copy link
Contributor

luizeof commented Sep 8, 2024

Same here ... using Docker, n8n in queue mode ...

The nodes work, the webhook receives the data, the node responds to the webhook and executes but is not responded to by the request until it times out.

No error is generated, and the execution history shows that it was executed successfully.

@suneetk92
Copy link
Author

Same here ... using Docker, n8n in queue mode ...

The nodes work, the webhook receives the data, the node responds to the webhook and executes but is not responded to by the request until it times out.

No error is generated, and the execution history shows that it was executed successfully.

Exactly the same. I also have n8n in queue mode.
Just for testing, running the same version in normal mode is running fine.

@felipeslo
Copy link

image

The webhook adds the task to the queue in Redis, the Worker picks up the task, executes it, and successfully saves it to the database. Meanwhile, the Webhook remains in an endless search for the response in the database.

@LeoPQDT
Copy link

LeoPQDT commented Sep 9, 2024

I am facing the same issue too.
The workaround I found is set the Webhook to respond on Last Node Finishes and place an Aggregate node as the last node in order to wrap up the list content received for it in a single response attribute (Data for example).

@coroschina
Copy link

The same issue exists in version 1.58.1

@easydigi
Copy link

easydigi commented Sep 9, 2024

I also have the same problem.

@Joffcom
Copy link
Member

Joffcom commented Sep 9, 2024

The example workflow is working fine for me in 1.58.1.

@coroschina @easydigi @LeoPQDT @luizeof can you all try the test workflow provided in 1.58.1 and see if you have the same issue.

My test was with Postgres DB and 4 workers.

@suneetk92
Copy link
Author

It's the same issue with 1.58.1.

All versions after 1.57.0 are affected.

I also have postgresDB with 3 workers and 3 webhooks

@LeoPQDT
Copy link

LeoPQDT commented Sep 9, 2024

The example workflow is working fine for me in 1.58.1.

@coroschina @easydigi @LeoPQDT @luizeof can you all try the test workflow provided in 1.58.1 and see if you have the same issue.

My test was with Postgres DB and 4 workers.

Hi Man, I'm running N8N in 1.58.1 and the same issue keep alive.

@easydigi
Copy link

easydigi commented Sep 10, 2024

The example workflow is working fine for me in 1.58.1.

@coroschina @easydigi @LeoPQDT @luizeof can you all try the test workflow provided in 1.58.1 and see if you have the same issue.

My test was with Postgres DB and 4 workers.

I am experiencing this problem under version 1.58.1.

n8n:1.58.1 + postgresDB + 2 x workers + 2 x webhooks

@Joffcom
Copy link
Member

Joffcom commented Sep 10, 2024

Are you all using webhook workers?

@lucianodltec
Copy link

+1

1 similar comment
@adrian-martinez-onestic
Copy link
Contributor

+1

@felipeslo
Copy link

Vocês todos estão usando webhook workers?

yes

@guibarbas
Copy link

I also have the same problem.

1 similar comment
@bahoan
Copy link

bahoan commented Sep 12, 2024

I also have the same problem.

@ivov
Copy link
Contributor

ivov commented Sep 12, 2024

Can anyone with the issue please try this image to confirm the fix?

https://hub.docker.com/layers/n8nio/n8n/PR-10781-restore-queue-listeners-for-webhook-process/images/sha256-7afb760b0415b92abec7e20d318ff39f33b6701d7710bb5fdf6de8445c79f409

@adrian-martinez-onestic
Copy link
Contributor

With my setup, I can replicate the issue for n8n versions >= 1.57.0, and using suggested image in the same setup fixes the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in linear Issue or PR has been created in Linear for internal review
Projects
None yet
Development

Successfully merging a pull request may close this issue.