n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
44.44k stars 5.92k forks source link

Tunneled webhook is closed after first call #9655

Open GGG1998 opened 2 months ago

GGG1998 commented 2 months ago

Bug Description

I can't run webhook more than once because I receive 408 code and later(after 10 minutes) 504 code. Another result after spam F5 {"code":404,"message":"The requested webhook \"4d78453d-0205-4548-9eec-76de7e699e23\" is not registered.","hint":"Click the 'Test workflow' button on the canvas, then try again. (In test mode, the webhook only works for one call after you click this button)"}

To Reproduce

You can use my docker image and you cannot be on the company network if you work at n8n

version: '3.7'

services:
  mongo:
    image: mongodb/mongodb-community-server:latest
    restart: always
    ports:
      - 27017:27017
    hostname: mongodb
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: secret123
    volumes:
      - dbdata:/data/db/
    networks:
      - n8n
  pg:
    image: postgres:16-alpine
    restart: always
    environment:
      POSTGRES_USER: root
      POSTGRES_DB: n8n_workflows
      POSTGRES_PASSWORD: secret123
    volumes:
      - dbpgdata:/var/lib/postgresql/data
    networks:
      - n8n
  n8n:
    image: n8nio/n8n
    depends_on:
      - pg
    volumes:
      - n8ndata:/home/node/.n8n
    networks:
      - n8n
    ports:
      - 5678:5678
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: pg
      DB_POSTGRESDB_PORT: 5432
      DB_POSTGRESDB_DATABASE: n8n_workflows
      DB_POSTGRESDB_USER: root
      DB_POSTGRESDB_PASSWORD: secret123
      N8N_LOG_LEVEL: debug
      N8N_LOG_OUTPUT: console,file
      # NODE_ENV: development
      # N8N_HOST: '${SUBDOMAIN}.${DOMAIN_NAME}'
      # N8N_PORT: 5678
      # N8N_PROTOCOL: https
      # WEBHOOK_URL: 'https://${SUBDOMAIN}.${DOMAIN_NAME}/'
      # GENERIC_TIMEZONE: ${GENERIC_TIMEZONE}
    command: "start --tunnel"

networks:
  n8n:
    driver: bridge

volumes:
  dbdata:    
  dbpgdata:
  n8ndata:

Expected behavior

If I run a workflow with dozens of events I would expect to receive all of them

Operating System

macos

n8n Version

1.41.1

Node.js Version

18.20.2

Database

PostgreSQL

Execution mode

main (default)

netroy commented 2 months ago

are you seeing this for the webhooks that you start using "Test Workflow" or "Listen for test event" via the UI, or also for production webhooks that get created when you activate the workflow?

GGG1998 commented 2 months ago

@netroy I click "Listen for test event" via UI. Env is set on development. Also I set DEBUG mode image

Joffcom commented 2 months ago

@GGG1998 is this for a production environment or is it just a test?

I noticed you mentioned a company network as well, Is it possible that there is a company firewall / proxy that is closing the tunnel connection as I have seen issues in the past where they can sometimes close tunnels if not set to be allowed.

GGG1998 commented 2 months ago

I refer to n8n you cannot be on the company network _if you work at n8n_ because I wanted from you 1:1 chance to reproduce my problem. All I tested on my local computer in my home network.

netroy commented 2 months ago

I click "Listen for test event" via UI to me this sounds like you are using a webhook test URL, which is valid only for one use.

You need to use the production url for non-testing purposes. More info here.

GGG1998 commented 2 months ago

Still nothing, additionally I'd like to mention that in AWS SNS is status Pending confirmation Could you tell me in what environment you run n8n?

netroy commented 2 months ago

in AWS SNS is status Pending confirmation

not clear how that's related to this issue. are you using the SNS node? It'd be helpful if you could share a sample workflow when reporting issues, otherwise we don't have enough context to provide support.

Could you tell me in what environment you run n8n?

We (and our customers) run n8n in lot's of different environments, including AWS.

GGG1998 commented 2 months ago

It's related. SNS

Screenshot 2024-06-13 at 14 45 32 Screenshot 2024-06-13 at 14 45 54

store link to tunneled webhook.

GGG1998 commented 2 months ago

@netroy any idea?

netroy commented 2 months ago

unfortunately I still don't understand the issue. I'll let someone else handle this 🙏🏽

Joffcom commented 2 months ago

Hey @GGG1998,

I just want to go back to an earlier post...

You can use my docker image and you cannot be on the company network if you work at n8n

Just to clarify, Does this only fail from a company network or do you have the issue when running from your own machine on your own network?

I would also recommend not using the tunnel as we will be removing it soon as there are better options available like Cloudflare and NGROK.