Redis using the private connection
leadbox
PROOP

4 months ago

Hi Railway Support Team,

I’m encountering an issue when trying to connect to Redis using the private connection within my project.

Here are the details:

  • I’m using the REDIS_PRIVATE_URL environment variable provided by Railway.

  • My NestJS service and Redis plugin are in the same Railway project.

  • The Redis connection string is something like:

    redis://default:<password>@redis.railway.internal:6379

  • When I try to connect using ioredis, I receive the following error:

[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND redis.railway.internal

t seems like the internal hostname redis.railway.internal is not resolving from within my API service container.

Can you help me confirm:

  1. Whether the Redis plugin is properly linked to my service?

  2. If there are any known DNS issues or misconfigurations preventing the service from resolving internal domains?

Let me know if you need access to my project or specific service IDs.

Thanks in advance!

Best regards,

Solved$20 Bounty

4 Replies

Railway
BOT

4 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!


brody
EMPLOYEE

4 months ago

This thread has been marked as public for community involvement, as it does not contain any sensitive or personal information. Any further activity in this thread will be visible to everyone.

Status changed to Open brody 5 months ago


clashing
FREE

4 months ago

Can you provide the snippet in which you are instantiating the redis class? (const redis = new Redis)


aalfath
PRO

4 months ago

Hey, you have to use family: 0 during the initialization of Redis class.

Like so if you use NodeJS:

I've had the same problem and I was able to solve it that way.


leadbox
PROOP

4 months ago


Status changed to Solved brody 5 months ago


Loading...