Using a Shared variable across services
matteyahmed
HOBBYOP

a month ago

prjid: 6db5b642-1bc1-47d9-a39d-9f6b9c87f4f0 M tying to use a REDISURL among 2 services, using shared variables, however m facing this issue:

ERROR:app.redis.consumer:❌ Redis connection failed: Error -2 connecting to redis.railway.internal:6379. Name or service not known.

well if i use the REDISPUBLICURL it works without a prob, what cud i be doing wrong?

Solved

13 Replies

Go to your Redis service, networking tab, and set the URL to redis instead of Redis.
Redeploy after.


matteyahmed
HOBBYOP

a month ago

you mean in settings right? Redis->Settings->private networking>
its already in in lower case


I assume the services are in the same project.
Are you able ping redis.railway.internal from one of your containers? (Via Railway SSH)


matteyahmed
HOBBYOP

a month ago

nop, they are not in the same service,


Can you rephrase that?
Are the services in the same project?


matteyahmed
HOBBYOP

a month ago

same proj


Are you able ping redis.railway.internal from one of your containers? (Via Railway SSH)


matteyahmed
HOBBYOP

a month ago

in the same service yes


matteyahmed
HOBBYOP

a month ago

wait haven't tested from diff service.


matteyahmed
HOBBYOP

a month ago

i get this error:
Error -2 connecting to redis.railway.internal:6379. Name or service not known.


a month ago

Redis is not in the same environment.


-# Ref! He's cheating! (jk)


Well what Brody said. You need services to be in the same environment in order to communicate over the internal network.


Status changed to Solved brody 25 days ago


Loading...