Dear Community,
on my docker compose setup I cannot receive any test webhooks and rest callbacks for my credentials.
I always get the following errors when trying to get the test webhook:
(after clicking “Listen for Test Event”)
Cannot GET /test/f02tdc527-f85c-41fa-a603-aa5atdsd0cdf44
and like this when trying to update or add my oauth credentials
Cannot GET /rest/f02tdc527-f85c-41fa-a603-aa5atdsd0cdf44
This is my Setup
Docker Compose File
version: '3.9'
volumes:
db_storage:
n8n_storage:
redis_storage:
letsencrypt_storage:
## n8n Environment Variables for Main, Worker and Webhook
x-shared: &shared
image: n8nio/n8n:${N8N_VERSION_TAG}
restart: always
environment:
- GENERIC_TIMEZONE
### - n8n Security
- N8N_PORT
- N8N_USER_MANAGEMENT_DISABLED
- N8N_BASIC_AUTH_ACTIVE
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- N8N_ENCRYPTION_KEY
### - n8n Customization
- N8N_DIAGNOSTICS_ENABLED
- N8N_PERSONALIZATION_ENABLED
- N8N_HIRING_BANNER_ENABLED
### - n8n - Email
- N8N_EMAIL_MODE
- N8N_SMTP_HOST
- N8N_SMTP_PORT
- N8N_SMTP_USER
- N8N_SMTP_PASS
- N8N_SMTP_SENDER
- N8N_SMTP_SSL
### - n8n Execution
- N8N_LOG_LEVEL
- N8N_DISABLE_PRODUCTION_MAIN_PROCESS
- EXECUTIONS_MODE
- EXECUTIONS_PROCESS
- EXECUTIONS_DATA_SAVE_ON_SUCCESS
- EXECUTIONS_DATA_SAVE_ON_ERROR
- EXECUTIONS_DATA_PRUNE
- EXECUTIONS_DATA_MAX_AGE
- N8N_DEFAULT_BINARY_DATA_MODE
- N8N_AVAILABLE_BINARY_DATA_MODES
- NODE_OPTIONS
### - n8n Database
- DB_TYPE
- DB_POSTGRESDB_PORT
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB}
- DB_POSTGRESDB_USER=${POSTGRES_NON_ROOT_USER}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_NON_ROOT_PASSWORD}
- DB_POSTGRESDB_HOST
- DB_LOGGING_MAX_EXECUTION_TIME
### - n8n Queue
- QUEUE_BULL_REDIS_PORT
- QUEUE_BULL_REDIS_HOST
- QUEUE_HEALTH_CHECK_ACTIVE
### - Webhook
- WEBHOOK_URL
- N8N_ENDPOINT_WEBHOOK
- N8N_ENDPOINT_WEBHOOK_TEST
- N8N_ENDPOINT_WEBHOOK_WAIT
- N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN
depends_on:
- postgres
- redis
volumes:
- n8n_storage:/home/node/.n8n
- ${N8N_LOCAL_STORAGE}:/files
services:
####### - Traefik Reverse Proxy
traefik:
image: traefik:${TRAEFIK_VERSION_TAG}
restart: on-failure
command:
- "--log.level=INFO"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.dnschallenge=true"
- "--certificatesresolvers.myresolver.acme.dnschallenge.provider=route53"
- "--certificatesresolvers.myresolver.acme.email=${LETSENCRYPT_EMAIL}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
environment:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_HOSTED_ZONE_ID
volumes:
- letsencrypt_storage:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
####### - ProstgreSQL Databse
postgres:
image: postgres:${POSTGRESQL_VERSION_TAG}
restart: always
environment:
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
- POSTGRES_NON_ROOT_USER
- POSTGRES_NON_ROOT_PASSWORD
volumes:
- db_storage:/var/lib/postgresql/data
- ${DB_INIT_FILE}:/docker-entrypoint-initdb.d/init-data.sh
healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s
timeout: 5s
retries: 10
####### - Redis Queue Databse
redis:
image: redis:${REDIS_VERSION_TAG}
restart: always
volumes:
- redis_storage:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 10
####### - n8n Main Process
n8n-main:
<<: *shared
command: ${N8N_MAIN_COMMAND}
labels:
- "traefik.enable=true"
- "traefik.http.routers.n8n-main.rule=Host(`${N8N_UI_SUBDOMAIN}.${DOMAIN_NAME}`)"
- "traefik.http.routers.n8n-main.entrypoints=websecure"
- "traefik.http.routers.n8n-main.tls.certresolver=myresolver"
- "traefik.http.middlewares.n8n-main.headers.SSLRedirect=true"
- traefik.http.middlewares.n8n-main.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n-main.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n-main.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n-main.headers.forceSTSHeader=true
- traefik.http.middlewares.n8n-main.headers.SSLHost=${DOMAIN_NAME}
- traefik.http.middlewares.n8n-main.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n-main.headers.STSPreload=true
####### - n8n Workers
n8n-worker-1:
<<: *shared
command: ${N8N_WORKER_COMMAND}
n8n-worker-2:
<<: *shared
command: ${N8N_WORKER_COMMAND}
n8n-worker-3:
<<: *shared
command: ${N8N_WORKER_COMMAND}
####### - n8n Webhook
n8n-webhook:
<<: *shared
command: ${N8N_WEBHOOK_COMMAND}
labels:
- "traefik.enable=true"
- "traefik.http.routers.n8n-webhook.rule=Host(`${N8N_WEBHOOK_SUBUDOMAIN}.${DOMAIN_NAME}`)"
- "traefik.http.routers.n8n-webhook.entrypoints=websecure"
- "traefik.http.routers.n8n-webhook.tls.certresolver=myresolver"
- "traefik.http.middlewares.n8n-webhook.headers.SSLRedirect=true"
- traefik.http.middlewares.n8n-webhook.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n-webhook.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n-webhook.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n-webhook.headers.forceSTSHeader=true
- traefik.http.middlewares.n8n-webhook.headers.SSLHost=${DOMAIN_NAME}
- traefik.http.middlewares.n8n-webhook.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n-webhook.headers.STSPreload=true
Environment Variables
######## Public Domains
DOMAIN_NAME=example.com
N8N_UI_SUBDOMAIN=n8n
N8N_WEBHOOK_SUBUDOMAIN=webhook.n8n
WEBHOOK_URL=https://webhook.n8n.example.com/
######## Services volumes and storage locoations
DB_INIT_FILE=/opt/n8n/init-data.sh
N8N_LOCAL_STORAGE=/local-files
######## Services Versions
TRAEFIK_VERSION_TAG=v2.9.6
POSTGRESQL_VERSION_TAG=12.13
REDIS_VERSION_TAG=alpine
N8N_VERSION_TAG=0.209.2
####### - Traefik Reverse Proxy
[email protected]
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_HOSTED_ZONE_ID=
####### - ProstgreSQL Databse
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DB=
POSTGRES_NON_ROOT_USER=
POSTGRES_NON_ROOT_PASSWORD=
####### - n8n Processes
GENERIC_TIMEZONE=CET
N8N_MAIN_COMMAND=/bin/sh -c "sleep 5; n8n start"
N8N_WORKER_COMMAND=/bin/sh -c "sleep 5; n8n worker --concurrency=50"
N8N_WEBHOOK_COMMAND=/bin/sh -c "sleep 5; n8n webhook"
## Security
N8N_PORT=5678
N8N_USER_MANAGEMENT_DISABLED=false
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=root
N8N_BASIC_AUTH_PASSWORD=
N8N_ENCRYPTION_KEY=
## Customization
N8N_DIAGNOSTICS_ENABLED=false
N8N_PERSONALIZATION_ENABLED=false
N8N_HIRING_BANNER_ENABLED=false
## Email
N8N_EMAIL_MODE=smtp
N8N_SMTP_HOST=smtp.example.com
N8N_SMTP_PORT=587
N8N_SMTP_USER=
N8N_SMTP_PASS=
N8N_SMTP_SENDER=n8n <[email protected]>
N8N_SMTP_SSL=false
## Execution
N8N_LOG_LEVEL=error
N8N_DISABLE_PRODUCTION_MAIN_PROCESS=true
EXECUTIONS_MODE=queue
EXECUTIONS_PROCESS=main
EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
EXECUTIONS_DATA_SAVE_ON_ERROR=all
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=14
N8N_DEFAULT_BINARY_DATA_MODE=filesystem
N8N_AVAILABLE_BINARY_DATA_MODES=filesystem
NODE_OPTIONS="--max-old-space-size=4096"
## Database
DB_TYPE=postgresdb
DB_POSTGRESDB_PORT=5432
DB_POSTGRESDB_HOST=postgres
DB_LOGGING_MAX_EXECUTION_TIME=0
## Queue
QUEUE_BULL_REDIS_PORT=6379
QUEUE_BULL_REDIS_HOST=redis
QUEUE_HEALTH_CHECK_ACTIVE=true
## Webhook
N8N_SKIP_WEBHOOK_DEREGISTRATION_SHUTDOWN=true
N8N_ENDPOINT_WEBHOOK=prod
N8N_ENDPOINT_WEBHOOK_TEST=test
N8N_ENDPOINT_WEBHOOK_WAIT=wait
On traefik, on n8n, webhook, main or worker there are not logs given at the time of error.
The production webhooks are working for me. Also when running without the webhook service, test webhooks and rest callbacks are working on the main n8n service.
I read many post of people trying to make webhooks work on another path of the main n8n domain, but they always used a workaround like non dockerized nginx to get it routed. So I just tried to make the webhook on a seperated sub-domain and it was working for production calls, just test webhooks and rest-callbacks have some communication problem.
Does anyone have a idea what it could be and how to solve it?