REDIS Lost / Recovered only inside n8n

hi all im running n8n in K8s
and having this in logs

2026-08-11T12:50:34.114Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:50:35.157Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:39.507Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:41.116Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:42.144Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:54.513Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:55.536Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:54:59.355Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:55:00.381Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:55:36.502Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:55:37.525Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:59:41.469Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:59:43.077Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:59:44.103Z | info  | Recovered Redis connection {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

2026-08-11T12:59:56.775Z | warn  | Lost Redis connection. Trying to reconnect in 1s... (0s/60s) {"scopes":["redis","scaling"],"file":"redis-client.service.js"}

i tested from my PC and from redis-cli pod

root@redis-test:/data# while true; do redis-cli -h ``XYZ-9605.l.aivencloud.com`` -p 21274 -a ZYX --no-auth-warning ping; sleep 2; done
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG
PONG

and it is woking good
only from n8n pod it is Lost / Recovered

can it be sorted ?
any advice ?

Hey @Antonio1, while you wait for a response, here are some things that might help:

Suggested resources

Automatically matched to your question.

Docs:

Forum:

@JavierOrjNeq, @tridi, @rodolfo.saldanha - you’ve helped with similar issues before, can you take a look?

Automatically suggested by n8n’s community bot. It’s a pilot - please share feedback here.

Hey @Antonio1

Your PING loop is exactly why it looks healthy outside n8n. It sends a command every 2 seconds so that connection never goes idle. n8n’s queue connections are different, BullMQ holds blocking and pub/sub sockets that sit idle for minutes at a time.

Aiven sets redis_timeout (valkey_timeout on newer services) to 300 seconds by default and closes any idle connection at that mark. Your timestamps line up with it, the drops cluster around 12:50, 12:55 and 13:00.

Fix it in the Aiven console under Service settings > Advanced configuration, set redis_timeout to 0, or from the CLI:

avn service update --project -c redis_timeout=0

Two notes. If Aiven rejects 0 on your plan, just push it well above your longest idle gap. And you will still see one reconnect roughly every 12 hours, Aiven force closes SSL connections at that point and it is not configurable.

Worth fixing even though it recovers on its own, a drop mid job can lose the BullMQ lock and leave executions stalled.

Hey @Antonio1

Aiven (and most managed Redis services) requires TLS/SSL for all connections. Your redis-cli test command did not include the --tls flag. If that command worked without --tls, it might be due to your local configuration, but n8n’s internal client will almost certainly fail or behave unstably if TLS is not explicitly enabled.

The Fix: Ensure you have the following environment variable set in your n8n Kubernetes deployment:

QUEUE_BULL_REDIS_TLS=true

If Aiven requires a specific CA certificate (which it usually does), you may also need to ensure the n8n container trusts the Aiven CA or provide the certificate.

Managed providers like Aiven often have aggressive “Idle Connection Timeouts.” If n8n isn’t actively sending commands to Redis for a short period, the Aiven firewall/load balancer will silently drop the connection. The redis-cli test you ran works because you used a while true loop with a 2-second sleep, which keeps the connection “active” by constantly sending ping commands.

The Fix: While n8n doesn’t expose every single ioredis option directly via environment variables, you should try increasing the timeout threshold to make the client more resilient:

QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD=30000  # Increase to 30s

To rule out the TLS issue completely, please run your test again from your redis-test pod, but explicitly include the TLS flag:

while true; do 
  redis-cli --tls -h XYZ-9605.l.aivencloud.com -p 21274 -a ZYX --no-auth-warning ping
  sleep 2
done
  • If this command fails or hangs: Then your network/pod definitely needs TLS enabled to talk to Aiven.
  • If this command works perfectly: Then the issue is specifically how the n8n/Bull client is handling the connection lifecycle (likely needing the QUEUE_BULL_REDIS_TLS=true variable to match).

Does these help?

thanks
did not notise that
will try
have a wonderfull day

thanks
you have outdated info
nowadays they do support without TLS

Strange, that is not my impression

Small correction on QUEUE_BULL_REDIS_TIMEOUT_THRESHOLD, that one won’t help here. It controls how long n8n keeps retrying before giving up after Redis goes away, it doesn’t stop the server closing an idle socket. Your logs already show (0s/60s), so you’re on a 60 second threshold, double what was suggested, and the drops still happen.

The close is server side, so it has to be fixed on the Aiven service, not in the n8n env.

after i set valkey_timeout 900
Lost/Recovered are less frequently
Many Many THANKS !!!
:grinning_face:

Thanks for letting us know about this, We have created CAT-4042 as the internal dev ticket to look into it.