I am trying to set up n8n with Redis using docker-compose, but I am encountering some issues with the Redis connection. I have checked that Redis is running inside the container and I am able to connect to Redis from within the n8n container. I also have access to Redis from the local server. However, when I try to run n8n, it is unable to connect to Redis and the following error is displayed in the logs:
Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/app.bot
starting server on /tmp/app.bot
starting TLS server false
starting server as Unix || Windows Socket
ipc bot server started
Initializing n8n process
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
n8n ready on 0.0.0.0, port 5678
Version: 0.221.2
Redis unavailable - trying to reconnect...
================================
Start Active Workflows:
================================
- EDU_PAY (ID: 1)
=> Started
- Calendar_Proteco_Event (ID: 2)
=> Started
Editor is now accessible via:
https://n8n.com:5678/***** not real :)
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Unable to connect to Redis after 10000. Exiting process
Doesn’t work, I tried it:
QUEUE_BULL_REDIS_URL=redis
QUEUE_BULL_REDIS_HOST=redis
QUEUE_BULL_REDIS_URL=redis://redis:6379
QUEUE_BULL_REDIS_HOST=redis://redis:6379
Last session crashed
♥
Server path not specified, so defaulting to ipc.config.socketRoot + ipc.config.appspace + ipc.config.id /tmp/app.bot
starting server on /tmp/app.bot
starting TLS server false
starting server as Unix || Windows Socket
ipc bot server started
Initializing n8n process
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
n8n ready on 0.0.0.0, port 5678
Version: 0.221.2
Redis unavailable - trying to reconnect...
================================
Start Active Workflows:
================================
- EDU_PAY (ID: 1)
=> Started
- Calendar_Proteco_Event (ID: 2)
=> Started
Editor is now accessible via:
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Redis unavailable - trying to reconnect...
Unable to connect to Redis after 10000. Exiting process.
log from redis server
1:C 15 Apr 2023 08:29:40.535 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 15 Apr 2023 08:29:40.536 # Redis version=7.0.10, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 15 Apr 2023 08:29:40.536 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
1:M 15 Apr 2023 08:29:40.536 * monotonic clock: POSIX clock_gettime
1:M 15 Apr 2023 08:29:40.545 * Running mode=standalone, port=6379.
1:M 15 Apr 2023 08:29:40.545 # Server initialized
1:M 15 Apr 2023 08:29:40.545 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 15 Apr 2023 08:29:40.547 * Loading RDB produced by version 7.0.10
1:M 15 Apr 2023 08:29:40.548 * RDB age 10 seconds
1:M 15 Apr 2023 08:29:40.548 * RDB memory usage when created 0.82 Mb
1:M 15 Apr 2023 08:29:40.548 * Done loading RDB, keys loaded: 4, keys expired: 0.
1:M 15 Apr 2023 08:29:40.548 * DB loaded from disk: 0.001 seconds
1:M 15 Apr 2023 08:29:40.548 * Ready to accept connections
So it does work with just the single flag? So there sounds like there is some other issue. I’d suggest starting up with debug logging then N8N_LOG_LEVEL=debug, then if you’re feeling adventurous DEBUG=*.
Looks like you didn’t fill out the help template, so no much more I can offer.
@roughriver74 it looks like PostgreSQL errors are caused by multiple worker nodes trying to write to specific postgresql tables in parallel. I configured containers to start one after another, and this error does not come anymore: