Private Networking Seems to be Broken in my Project

Project ID 646e0c5a-07fd-4ade-aaed-c92750d977ae I can't seem to use private networking at all in this project. Redis is not reachable on REDIS_PRIVATE_URL and neither is my database on DATABASE_PRIVATE_URL. Only in this project. I do not seem to have issues in other projects.
10 Replies
Percy
Percy10mo ago
Project ID: 646e0c5a-07fd-4ade-aaed-c92750d977ae
Brody
Brody10mo ago
hey can you try adding a 3 second sleep to your start command?
eth_degen
eth_degen10mo ago
it doesn't work even when i try connecting to redis minutes after start
Brody
Brody10mo ago
ioredis?
eth_degen
eth_degen10mo ago
yep
Brody
Brody10mo ago
you need to set family to 0 heres some example code that works
import Redis from "ioredis";

const redisURL = new URL(process.env.REDIS_PRIVATE_URL);

const redis = new Redis({
family: 0,
host: redisURL.hostname,
port: redisURL.port,
username: redisURL.username,
password: redisURL.password
});

console.log(await redis.ping());
import Redis from "ioredis";

const redisURL = new URL(process.env.REDIS_PRIVATE_URL);

const redis = new Redis({
family: 0,
host: redisURL.hostname,
port: redisURL.port,
username: redisURL.username,
password: redisURL.password
});

console.log(await redis.ping());
eth_degen
eth_degen10mo ago
interesting thx lemme try! works like a charm!! thx much!!!
Brody
Brody10mo ago
no problem!
simoelalj
simoelalj10mo ago
I had exactly the same issue and adding that parameter fixed it. Do you mind sharing what does the family option means?
Brody
Brody10mo ago
by default for some unknown reason family is set to 4 meaning only use IPv4 networking, but the private network is IPv6 only, so it must be set to 0 to allow both IPv4 and IPv6 networking
Want results from more Discord servers?
Add your server