N8n loses connection to Redis permanently after redis container restart

Hi everyone,
In our Google k8s cluster we have n8n pods and they connect to Redis.
Sometimes the redis pod restarts for whatever reason and n8n simply can’t reconnect to it even if we use a k8s service for all our cluster connections.

I keep on seeing these errors even if the redis pod is up shortly after:

[ioredis] Unhandled error event: Error: connect ECONNREFUSED 10.4.34.46:6379

The only solution I’ve found is to actually restart the entire n8n deployment.

kubectl rollout restart deployment/n8n

Is there an automated way of doing this please?

Information on your n8n setup

  • n8n version: 1.37.2
  • Database (default: SQLite): Redis
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): docker image: n8nio/n8n:0.149.0
  • Operating system:

Hey @msar

Welcome to the community :raised_hands:

The econnrefused typically means the service on that IP and port is actively refusing the connection, I am not sure why that would happen but it sounds like it is an issue outside of the n8n application.

When Redis restarts is it still using the same ip and port? It could be worth updating to a newer release of n8n as I think we may have made some redis changes a few versions back but this does seem very odd.

It’s using the k8s service, so it should update IP automatically, but that doesn’t happen

Hey @msar,

Do you have n8n pointing to an IP or hostname for Redis? Maybe there is some caching involved?

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