Update using Docker n8n and Rabbitmq is resetting n8n installation

Last week I installed n8n and RabbitMQ through Docker on a VPN machine.

It was working normally. Today, when I went to update using the commands below, everything ran normally, but the n8n rebooted losing all settings, flows, etc. (I recovered with backup).

What am I doing wrong?

Commands:
apt-get update
apt upgrade
docker-compose pull
docker-compose down
docker-compose up -d

My docker-compose.yml
version: “3”

services:
traefik:
image: “traefik”
restart: always
command:
- “–api=true”
- “–api.insecure=true”
- “–providers.docker=true”
- “–providers.docker.exposedbydefault=false”
- “–entrypoints.web.address=:80”
- “–entrypoints.web.http.redirections.entryPoint.to=websecure”
- “–entrypoints.web.http.redirections.entrypoint.scheme=https”
- “–entrypoints.websecure.address=:443”
- “–certificatesresolvers.mytlschallenge.acme.tlschallenge=true”
- “–certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}”
- “–certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json”
ports:
- “80:80”
- “443:443”
volumes:
- ${DATA_FOLDER}/letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock:ro

n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
ports:
- “127.0.0.1:5678:5678”
labels:
- traefik.enable=true
- traefik.http.routers.n8n.rule=Host(${SUBDOMAIN}.${DOMAIN_NAME})
- traefik.http.routers.n8n.tls=true
- traefik.http.routers.n8n.entrypoints=web,websecure
- traefik.http.routers.n8n.tls.certresolver=mytlschallenge
- traefik.http.middlewares.n8n.headers.SSLRedirect=true
- traefik.http.middlewares.n8n.headers.STSSeconds=315360000
- traefik.http.middlewares.n8n.headers.browserXSSFilter=true
- traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
- traefik.http.middlewares.n8n.headers.forceSTSHeader=true
- traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
- traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
- traefik.http.middlewares.n8n.headers.STSPreload=true
- traefik.http.routers.n8n.middlewares=n8n@docker
environment:
- N8N_BASIC_AUTH_ACTIVE=true
- N8N_BASIC_AUTH_USER
- N8N_BASIC_AUTH_PASSWORD
- N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
- N8N_PORT=5678
- N8N_PROTOCOL=https
- NODE_ENV=production
- WEBHOOK_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- RABBITMQ_CONNECTION_URL=amqp://guest:guest@rabbitmq:5672
depends_on:
- rabbitmq

rabbitmq:
image: rabbitmq:3-management
hostname: rabbit1
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- “15672:15672”
- “5672:5672”
volumes:
- ${DATA_FOLDER}/.n8n:/home/node/.n8n

My .env
N8N_BASIC_AUTH_USER=yyyyyyyyyy
N8N_BASIC_AUTH_PASSWORD=xxxxxxxx
N8N_HOST=server1.leads8.com.br
[email protected]
DATA_FOLDER=/root/n8n/
DOMAIN_NAME=leads8.com.br
SUBDOMAIN=server1
GENERIC_TIMEZONE=America/Sao_Paulo



(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.)
  • n8n version: 0.221.2
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

In time… The Rabbit is not reacheable at IP:15672 even after reinstall the Backup.

Hey @Evandro_Caruso,

It looks like you have the volume that should be used for n8n set to the Rabbit MQ container which is why the data is being lost. If you move that to the correct place it should be all good. n8n also doesn’t have a dependancy on Rabbit MQ so you don’t need the depends_on option there.

Sadly I am not sure why Rabbit is not available that could be a question for their community but it would be worth spending some time on the compose file to clean it up a bit.

1 Like

Tks Jon!

After several hours and reinstalls i did it!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.