Redis Client Error ConnectionTimeoutError: Connection timeout

I get a Redis Client Error ConnectionTimeoutError: Connection timeout when connecting to my redis instance (hosted on railway) in a railway deployment using the public url. Im able to connect to the redis instance from my local machine.
Solution:
are you on the v2 runtime?
Jump to solution
21 Replies
Percy
Percy5mo ago
Project ID: b820c80e-50e9-475a-85c6-89832fccdd8c
Mrxbox98
Mrxbox98OP5mo ago
b820c80e-50e9-475a-85c6-89832fccdd8c
Brody
Brody5mo ago
please use the private network to connect to the databases when deployed to railway
Brody
Brody5mo ago
show me the client code please
Mrxbox98
Mrxbox98OP5mo ago
https://i.mrxbox98.me/file/2024/07/Code_SRfGrtmhIO.png blurred part is the redis private url
Brody
Brody5mo ago
please use environment variables
Mrxbox98
Mrxbox98OP5mo ago
Same issue
Brody
Brody5mo ago
are you using reference variables as well?
Mrxbox98
Mrxbox98OP5mo ago
Yes
Brody
Brody5mo ago
show me how you have done that please
Brody
Brody5mo ago
okay and show me your client code now
Brody
Brody5mo ago
what version of the redis package are you using?
Mrxbox98
Mrxbox98OP5mo ago
latest, 4.6.15
Solution
Brody
Brody5mo ago
are you on the v2 runtime?
Mrxbox98
Mrxbox98OP5mo ago
No, should I switch to it?
Brody
Brody5mo ago
yes
Mrxbox98
Mrxbox98OP5mo ago
worked ty
Brody
Brody5mo ago
no problem
Want results from more Discord servers?
Add your server