a year ago
Internal Service URL is not working and returning DNS Exception.
Pinned Solution
a year ago
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
a year ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 single port (the primary PORT) for internal networking ?
- 🧵 Solved: Using public url instead of internal dns
- 🧵 Redis using the private connection
If you find the answer from one of these, please let us know by solving the thread!
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.
a year ago
It's a redis instance and i'm using this URL: ` ${{queue-kv.REDIS_URL}}`.
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.
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.
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.
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, }); ```
a year ago
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,` `});`
a year ago
let me try this as well!
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
a year ago
Any update, kulterryan
Status changed to Solved chandrika • 9 months ago
