Private network to Redis
madsmhm
PROOP

5 months ago

I have a problem with one of my services when its connecting to Redis with private network. It times out on build image because connection error(see image). I have similar services(also Sveltekit) in the same project that connects just fine with private network.

I have tried to update the Redis client(node-redis) to newest version and tried both setting the socket.family to 6 and back to 0 but both result in the same error. I have also tried to update the railway.json file and use runtime v2 which seems to be added to the services that works, but again same problem.

I have checked my other services is actually using the private network and that works just fine.

I have read and tried all the similiar threads to my problem without any luck.

Project: 5dfc53a8-dea9-46af-b0a0-536e51368af3
Enviroment: affbd9f7-3806-4a68-abfa-eed15539a690
Service: 8c4e4a65-d462-43a8-8478-fcd47fa90ffc

I have changed the ENV to use public network and it works right away.

Attachments

Solved

5 Replies

Railway
BOT

5 months ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


ray-chen
EMPLOYEE

5 months ago

I have a problem with one of my services when its connecting to Redis with private network. It times out on build image because connection error(see image). I have similar services(also Sveltekit) in the same project that connects just fine with private network.

Are you trying to use the private network during build time? Unfortunately private networking isn't available in builds yet.

I recommend https://docs.railway.com/guides/pre-deploy-command if you need to connect to Redis after build and before deploying.


Status changed to Awaiting User Response Railway 5 months ago


ray-chen

I have a problem with one of my services when its connecting to Redis with private network. It times out on build image because connection error(see image). I have similar services(also Sveltekit) in the same project that connects just fine with private network.Are you trying to use the private network during build time? Unfortunately private networking isn't available in builds yet.I recommend https://docs.railway.com/guides/pre-deploy-command if you need to connect to Redis after build and before deploying.

madsmhm
PROOP

5 months ago

That was the problem! We tried wrapping the Redis connection in a try catch block and after it timed out it continue the build and connected after deploy. But you say that we could maybe fix that with the pre-deploy command?


Status changed to Awaiting Railway Response Railway 5 months ago


david
EMPLOYEE

5 months ago

Yep! Did it work for you? Please let us know if still stuck


Status changed to Awaiting User Response Railway 5 months ago


madsmhm
PROOP

5 months ago

Yes it worked just fine! Thanks for quick reply.


Status changed to Awaiting Railway Response Railway 5 months ago


Status changed to Solved madsmhm 5 months ago


Loading...