Webhooks not working even with tunnel

I’m extremely new to all of this, so please excuse me if this is a stupid question. I’d also appreciate guidance.
So, I’ve been trying to set up n8n with webhooks to use with Chatwoot, but (so far) only managed to make it work on my localhost. I thought I’d at least try out the tunnel service to see if the webhooks worked, so I used this as my docker compose file:

version: '3'
    image: docker.n8n.io/n8nio/n8n
      - 5678:5678
    command: "start --tunnel"

(using Portainer, if that makes a difference).

Then I accessed n8n, created a webhook node (I tried both POST and GET, no authentication) and used the generated webhook link on Chatwoot like normal (I selected for it to trigger with every possible event).
Alas, it didn’t work. Even when sending and receiving messages on Chatwoot, nothing appears on the n8n node.
I tried to “Listen for the event test” and accessed the webhook link on my browser (I saw a youtube guide do that) and it also didn’t work. I got a small 404 on the top left of my screen.
The webhook link was different from when I didn’t use the “–tunnel” command, so I know it at least changed something.
I also tried to use other environment commands on the docker compose file like n8n_host, port, protocol, node_env and webhook_url, but nothing worked.
I’m sure I’m doing something wrong, I just don’t know what.

Information on your n8n setup

  • n8n version: 1.41.1
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker on Portainer
  • Operating system: Ubuntu 20.04

Hi @obtusefriend we have been hearing a few user concerns around webhooks but there hasn’t been a unifying cause identified yet. If possible, could you share the error you encountered?

I noticed I couldn’t get the tunnel working while doing some dev work. Using DEBUG=* it seems to be caused by localhost resolving to the IPv6 ::1 where n8n is seemingly only listening on IPv4

The workaround/fix is to start with this env var N8N_LISTEN_ADDRESS=::

N8N_DEV_RELOAD=true N8N_USER_MANAGEMENT_DISABLED=true N8N_LISTEN_ADDRESS=:: ./packages/cli/bin/n8n start --tunnel
1 Like

From: Errors since last n8n update (1.44.1) - #18 by netroy

you could try forcing IPv4 by adding this env variable to the docker stack: NODEJS_PREFER_IPV4=true

1 Like

Confirmed this also works