Issue Connecting to Redis via Private URL

sachinrohit-vtechPRO

5 months ago

Hi,

We are experiencing an issue connecting to our Redis instance using the private URL. Below are the details of the problem:

  • Redis Service Status: Accessible via the public URL, but not working with the private URL.

  • Variable Used: "REDIS_URL".

  • Scope of the Issue: This problem exists across all of our services when using private URLs or railway internal urls.

It seems there might be a configuration or network setting that we are missing. Could you please assist us in resolving this issue?

Thank you for your support!

Best regards,
Megha

Awaiting User Response

3 Replies

5 months ago

Hi Megha,

Which service are you trying to connect to Redis from?

If you're trying to connect to your reset-backend test server service to your Redis instance, you can replace the existing variables for that service (which connect via public network) with reference variables that point to Redis using the private network.

  • REDIS_HOST = ${{Redis.REDISHOST}}

  • REDIS_PORT = ${{Redis.REDISPORT}}

  • REDIS_PASSWORD = ${{Redis.REDIS_PASSWORD}}

Regards,

Christian


Status changed to Awaiting User Response railway[bot] 5 months ago


sachinrohit-vtechPRO

5 months ago

Hi Christian,

Thank you for your prompt response.

As per your suggestion, we updated our configuration to use the reference variables pointing to Redis via the private network:

  • REDIS_HOST: ${{Redis.REDISHOST}}

  • REDIS_PORT: ${{Redis.REDISPORT}}

  • REDIS_PASSWORD: ${{Redis.REDIS_PASSWORD}}

However, we are still facing connection issues. Below are the details of the error we encountered:

Error Message:

Redis operation failed: %Redix.ConnectionError{reason: :closed}

** (exit) an exception was raised:

** (Protocol.UndefinedError) protocol Jason.Encoder not implemented for %Redix.ConnectionError{reason: :closed} of type Redix.ConnectionError (a struct), Jason.Encoder protocol must always be explicitly implemented.

This seems to indicate that the connection to Redis is being unexpectedly closed. Could you please assist us in identifying the root cause? Additionally, if there are any further changes or checks we should perform, kindly let us know.

Looking forward to your support.

Best regards,
Megha


Status changed to Awaiting Railway Response railway[bot] 5 months ago


5 months ago

Railway private networking only works over IPv6. It looks like you're using Redix to connect. Could you see if you socket_opts: [:inet6] in your Redix configuration? It may be required to ensure you communicate with Redis over IPv6.


Status changed to Awaiting User Response railway[bot] 5 months ago


Issue Connecting to Redis via Private URL - Railway Help Station