Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Continuous Redis Connection Error After Reconfiguring Credentials #3182

Open
amerkurev opened this issue Sep 13, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@amerkurev
Copy link

amerkurev commented Sep 13, 2024

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:

  1. 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).
  2. Go to the Credentials section, delete the existing Redis URL.
  3. Go back to your chatflow, save it, and send a message in the chat.
  4. Then, in the Credentials section, create a new Redis URL with the same settings as before.
  5. Navigate back to your chatflow, reconfigure the Redis node with the new credentials created in the Credentials section.
  6. 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
image
image
image
image

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.

@asyrkovsky
Copy link

I have the same issue =(

@HenryHengZJ HenryHengZJ added the bug Something isn't working label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants