2 years ago
Hi I meet issue in private network.
Got a Web service (NestJs ServiceID: fc3e565a-50b0-41ae-a3ea-44a9aadecb6b) ( and try to connect on a Redis service (ServiceID : ccf1b33d-fab1-4357-84b4-9b5ae0427dd8).
Connection is made with bullmq which use ioredis client. When I try to connect on the redis with the public host and port everything is fine.
But on private network (using redis.railway.internal or just redis) got a ENOTFOUND error on the private network.
It's the same environment (anthm-pr-1585)
Could you help me ? Thanks !
1 Replies
2 years ago
Railway's private network is IPv6 only, but ioredis (and by extension bullmq) will default to IPv4, to tell ioredis to use both IPv6 and IPv4 you can set family to 0 in the constructor, here's a working example:
import { Queue } from "bullmq";
const redisURL = new URL(process.env.REDIS_PRIVATE_URL);
const queue = new Queue("Queue", {
connection: {
family: 0,
host: redisURL.hostname,
port: redisURL.port,
username: redisURL.username,
password: redisURL.password
}
});
console.log(await queue.getJobs());