Internal networking is not working
kulterryan
PROOP

a year ago

Internal Service URL is not working and returning DNS Exception.

Solved$10 Bounty

Pinned Solution

If you’re using ioredis on Railway with private networking, this config works for me:

export const queue_kv = new Redis(process.env.REDIS_QUEUE_URL, {

family: 0,

maxRetriesPerRequest: null,

enableOfflineQueue: true,

});

15 Replies

Railway
BOT

a year 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!


kulterryan
PROOP

a year ago

PFA. Screenshot of error. We have to switch to public URLs to make it work.

Attachments


a year ago

Hey, can you show a snippet of how you are accessing your service via private networking? The service that is being accessed via private networking has to listen on IPv6 and has to be referenced with http://${{service.RAILWAY_PRIVATE_DOMAIN}}:${{service.PORT}}, with service being the service's name.


kulterryan
PROOP

a year ago

It's a redis instance and i'm using this URL: ` ${{queue-kv.REDIS_URL}}`.


phoenixauro
HOBBY

a year ago

If your services are in different projects the internal url will not work, you need to use a public one.


kulterryan

It's a redis instance and i'm using this URL: \` `${{queue-kv.REDIS_URL}}`\`.

a year ago

In this case, please check out https://docs.railway.com/reference/errors/enotfound-redis-railway-internal, setting the family option to 0 should solve the problem.


phoenixauro

If your services are in different projects the internal url will not work, you need to use a public one.

kulterryan
PROOP

a year ago

all of my services are in the same project only.


uxuz

In this case, please check out <https://docs.railway.com/reference/errors/enotfound-redis-railway-internal>, setting the family option to 0 should solve the problem.

kulterryan
PROOP

a year ago

tried this as well but it was not working


kulterryan

tried this as well but it was not working

a year ago

Please provide a snippet of your code.


uxuz

Please provide a snippet of your code.

kulterryan
PROOP

a year ago

Queue KV:

export const queue_kv = new Redis(`${process.env.REDIS_QUEUE_URL}?family=0`, {
  maxRetriesPerRequest: null,
  enableOfflineQueue: true,
  offlineQueue: true,
});

kulterryan

Queue KV: ```typescript export const queue_kv = new Redis(`${process.env.REDIS_QUEUE_URL}?family=0`, { maxRetriesPerRequest: null, enableOfflineQueue: true, offlineQueue: true, }); ```

If you’re using ioredis on Railway with private networking, this config works for me:

export const queue_kv = new Redis(process.env.REDIS_QUEUE_URL, {

family: 0,

maxRetriesPerRequest: null,

enableOfflineQueue: true,

});


sanjeev-kumar78

If you’re using `ioredis` on Railway with private networking, this config works for me: `export const queue_kv = new Redis(process.env.REDIS_QUEUE_URL, {` ` family: 0,` ` maxRetriesPerRequest: null,` ` enableOfflineQueue: true,` `});`

kulterryan
PROOP

a year ago

let me try this as well!


kulterryan

let me try this as well!

a year ago

Hey, did you solve the problem?


clashing
HOBBY

a year ago

kulterryan, it's basically an issue that arises when you try to use the INTERNAL URL (which is meant to be used in Railway environment only) outside of Railway (most probably on your local machine). You can refer to this post to get more hold on this issue: https://station.railway.com/questions/backend-service-unable-to-connect-to-pos-22ad5b8c#kjs0

Do let me know if the helps


clashing

**kulterryan**, it's basically an issue that arises when you try to use the INTERNAL URL (which is meant to be used in Railway environment only) outside of Railway (most probably on your local machine). You can refer to this post to get more hold on this issue: <https://station.railway.com/questions/backend-service-unable-to-connect-to-pos-22ad5b8c#kjs0> Do let me know if the helps

clashing
HOBBY

a year ago

Any update, kulterryan


Status changed to Solved chandrika 9 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...