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

Enable IPv6 Support for Redis Database Connections Over a Private Netwoork #7421

Closed
AbdelrahmanAhmed605 opened this issue Oct 3, 2024 · 7 comments · Fixed by #7736
Closed

Comments

@AbdelrahmanAhmed605
Copy link

Bug Description

When attempting to connect to a Redis database over a private network, I get the following error: Error: getaddrinfo ENOTFOUND. I think it is because currently the caching system utilizes BullMQ, which relies on ioredis internally, and ioredis by default is configured to work only with IPv4 addresses.

Expected behavior

The expected behavior is for the twenty-server and twenty-worker to establish a successful connection to the Redis database over the private network, eliminating the ENOTFOUND error.

Technical inputs

I think this would require a change in the connection options for messageQueueModuleFactory in message-queue.module-factory

and possibly the socket properties for cacheStorageModuleFactory in cache-storage.module-factory

@AbdelrahmanAhmed605
Copy link
Author

I think that adding family: 0 to the connection option allows both IPv4 and IPv6. I tried adding it to the messageQueueModuleFactory and it seems to work. I am not sure if anything needs to be done to the cacheStorageModuleFactory but just editing the messageQueueModuleFactory seemed to work for me :)

@Bonapara
Copy link
Member

Bonapara commented Oct 4, 2024

@ijreilly what do you think?

@ijreilly
Copy link
Collaborator

ijreilly commented Oct 4, 2024

I have too limited knowledge on this, maybe @Weiko knows better?

@Weiko
Copy link
Member

Weiko commented Oct 8, 2024

LGTM, thanks for the technical input. Feel free to open a PR 👍

@FelixMalfait
Copy link
Member

Screenshot 2024-10-14 at 22 05 49

I'm going to close this since no PR was raised and it's possible to pass the parameter through the url (see screenshot from the Railway docs for example). But feel free to raise one

@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Product development ✅ Oct 15, 2024
@thomasmol
Copy link
Contributor

While it's true that you can pass the parameter through the URL, Twenty does not expose env vars for connection urls for redis, only for the HOST, PORT, USERNAME and PASSWORD. Should an env var be added e.g. REDIS_FAMILY or add REDIS_URL ?

@FelixMalfait
Copy link
Member

@thomasmol that's a good point - I didn't see that, we should probably replace REDIS_HOST, REDIS_PORT, REDIS_USERNAME, REDIS_PASSWORD by a single REDIS_URL param to be consistent with what we do on Postgres. Re-opening the issue, PR welcome :))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants