[BUG] Continuous Redis Connection Error After Reconfiguring Credentials
Describe the bug After reconfiguring Redis (deleting old credentials and creating new ones with the same settings), an error is continuously logged:
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16)
[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16)
...
To Reproduce Steps to reproduce the behavior:
- Create a working chatflow that uses Redis as Memory, similar to the screenshot below. Ensure that the Redis instance is "external" (e.g., in a neighboring container), and not local (
127.0.0.1:6379). - Go to the Credentials section, delete the existing Redis URL.
- Go back to your chatflow, save it, and send a message in the chat.
- Then, in the Credentials section, create a new Redis URL with the same settings as before.
- Navigate back to your chatflow, reconfigure the Redis node with the new credentials created in the Credentials section.
- Save the chatflow and send another message in the chat. Then open the flowise log, and you will see continuous errors like:
[ioredis] Unhandled error event: Error: connect ECONNREFUSED `127.0.0.1:6379
`
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16)
Problem behavior
Despite not using 127.0.0.1:6379 anywhere (we are using an "external" Redis instance), the connection attempts still target 127.0.0.1:6379. Moreover, the error continues to be logged infinitely, even after reconfiguring the Redis node. This issue persists until flowise is restarted.
Screenshots
Setup
- Installation [docker]
- Flowise Version [2.0.7]
- OS: [Linux]
Additional context
The issue might be related to the ioredis library's auto-reconnect logic, which by default, does not stop trying to reconnect. Here is an example from the ioredis documentation on how to control reconnection behavior with the retryStrategy option:
const redis = new Redis({
// This is the default value of `retryStrategy`
retryStrategy(times) {
const delay = Math.min(times * 50, 2000);
return delay;
},
});
Please investigate why the connection still attempts to reach 127.0.0.1:6379 and why the error is persistently logged, even after reconfiguration.
I have the same issue =(
Yep, happening to us too