Describe the problem/error/question
Everything working good in version 1.2.1
But I change docker image 1.6.1 I get error connection lost. I suppose I need to change something to the configuration. Any link or suggestions are appreciated. Thx
What is the error message (if any)?
Connection lost
Problem running workflow: lost connection to the server
Please share your workflow
n8n in a docker in swarm configuration, behind treafik reverse proxy. WEBHOOK_URL is set
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
Share the output returned by the last node
Information on your n8n setup
n8n version:
1.6.1 (1.2.1 working flowless)
Database (default: SQLite):
PostgreSQL
n8n EXECUTIONS_PROCESS setting (default: own, main):
Deprecated
Running n8n via (Docker, npm, n8n cloud, desktop app):
Docker
Operating system:
Debian 11
Hi @Kumanatsu Welcome to the community
@Jon might be a better help on this one, but could you post your Docker compose file (with anything sensitive redacted)? That way we can look at your configuration a little more closely
Also just a thought, but have you exposed the following ports in your Docker compose file?
- "80:80"
- "443:443"
thanks for the fast reply, this is the working file for that i use in version 1.2.1 but doesn’t work with version 1.6.1
# DOMAIN=example.com docker stack deploy -c n8n.yml n8n
# DOMAIN=example.com VERSION=1.2.1 docker stack deploy -c n8n.yml n8n
# DOMAIN=example.com VERSION=1.6.1 docker stack deploy -c n8n.yml n8n
version: '3.8'
services:
n8n:
image: n8nio/n8n:${VERSION:-1.2.1}
environment:
- NODE_ENV=production
- N8N_PROTOCOL=${SCHEME:-https}
- N8N_HOST=${DOMAIN:-n8n.localhost}
- WEBHOOK_URL=${SCHEME:-https}://${DOMAIN:-n8n.localhost}/
- VUE_APP_URL_BASE_API=${SCHEME:-https}://${DOMAIN:-n8n.localhost}/
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=${POSGRES_DATABASE:-n8n}
- DB_POSTGRESDB_USER=${POSTGRES_USER:-n8n}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD:-myp@ssw0rd}
- NODE_FUNCTION_ALLOW_EXTERNAL=${NODE_FUNCTION_ALLOW_EXTERNAL}
- N8N_EMAIL_MODE=${N8N_EMAIL_MODE:-smtp}
- N8N_SMTP_HOST=${SMTP_HOST}
- N8N_SMTP_PORT-${SMTP_PORT:-584}
- N8N_SMTP_USER=${SMTP_USER}
- N8N_SMTP_PASS=${SMTP_PASSWORD}
- N8N_SMTP_SENDER=${SMTP_FROM:[email protected] }
volumes:
- ${VOLUME_PATH}n8n:/home/node/.n8n
deploy:
labels:
- traefik.enable=true
- traefik.http.routers.n8n-${NUMBER:-1}.rule=Host(`${DOMAIN:-n8n.localhost}`)
- traefik.http.routers.n8n-${NUMBER:-1}.entrypoints=${SCHEME:-https}
- traefik.http.routers.n8n-${NUMBER:-1}.service=n8n-${NUMBER:-1}
- traefik.http.routers.n8n-${NUMBER:-1}.tls.certresolver=letsencrypt
- traefik.http.routers.n8n-${NUMBER:-1}.middlewares=n8n-${NUMBER:-1}
- traefik.http.services.n8n-${NUMBER:-1}.loadbalancer.server.port=5678
- traefik.http.middlewares.n8n-${NUMBER:-1}.headers.customResponseHeaders.Access-Control-Allow-Origin=*
- traefik.http.middlewares.n8n-${NUMBER:-1}.headers.customResponseHeaders.Access-Control-Allow-Headers=Content-Type
networks:
- traefik
- internal
postgres:
image: postgres:${POSTGRES_VERSION:-12-alpine}
environment:
- POSTGRES_DB=n8n
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=myp@ssw0rd
healthcheck:
test: ["CMD", "pg_isready", "-U", "n8n"]
volumes:
- ${VOLUME_PATH}postgres:/var/lib/postgresql/data
networks:
- internal
volumes:
n8n:
postgres:
networks:
internal:
driver: overlay
attachable: true
traefik:
external: true
name: traefik-net
this is the traefik.yml
version: '3.8'
services:
traefik:
image: traefik:${VERSION:-v2.10.3}
command:
# - --log.level=DEBUG
- --providers.docker
- --providers.docker.network=traefik-net
- --providers.docker.exposedByDefault=false
- --providers.docker.swarmMode=true
- --providers.docker.endpoint=unix:///var/run/docker.sock
- --entrypoints.http.address=:80
- --entrypoints.https.address=:443
- --entryPoints.http.proxyProtocol.trustedIPs=${TRUSTED_IPS:-127.0.0.1}
- --entryPoints.http.forwardedHeaders.trustedIPs=${TRUSTED_IPS:-127.0.0.1}
- --entryPoints.https.proxyProtocol.trustedIPs=${TRUSTED_IPS:-127.0.0.1}
- --entryPoints.https.forwardedHeaders.trustedIPs=${TRUSTED_IPS:-127.0.0.1}
- --entrypoints.http.http.redirections.entryPoint.to=https
- --entrypoints.http.http.redirections.entryPoint.scheme=https
- --entrypoints.http.http.redirections.entrypoint.permanent=true
- --certificatesresolvers.letsencrypt.acme.tlschallenge=true
- --certificatesresolvers.letsencrypt.acme.email=${ACME_EMAIL:[email protected] }
- --certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json
volumes:
- ${VOLUME_PATH}letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- {target: 80, published: 80, mode: host, protocol: tcp}
- {target: 443, published: 443, mode: host, protocol: tcp}
deploy:
mode: ${MODE:-replicated}
volumes:
letsencrypt:
networks:
default:
external: true
name: traefik-net
Jon
September 14, 2023, 9:10am
6
Hey @Kumanatsu ,
It sounds like it could be a websockets issue but I would expect to see that on 1.2.1 as well As a test could you set N8N_PUSH_BACKEND
to sse
and let me know if that helps?
1 Like