bwoodlt
February 19, 2023, 10:51pm
1
Hi All -
I’ve just setup a nodejs app on fly.io via a Dockerfile. However I’m having trouble connecting to the redis instance from within the app. The error messages at runtime:
2023-02-19T22:47:36Z [info][19/02/2023 22:47:36.751] [ERROR] Error: getaddrinfo ENOTFOUND fly-fc-redis.upstash.io
2023-02-19T22:47:36Z [info] at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
2023-02-19T22:47:36Z [info] at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)
2023-02-19T22:47:37Z [info]Starting clean up.
Any idea what I might need to do?
Node app running on port: 4000
and redis on 6379.
bwoodlt
February 21, 2023, 1:40pm
2
Thought I’d provide more context:
REDIS_URL=redis://some_user:some_pass@fly-fc-redis.upstash.io:6379/
// connection
const subscriber = new Redis(process.env.REDIS_URL, {
family: 6,
retry_strategy: (options) => Math.min(options.attempt * 100, 3000),
});
const redisInstance = subscriber.duplicate();
const publisher = new Redis(process.env.REDIS_URL, { family: 6 });
// error
2023-02-20T19:37:58Z [info][20/02/2023 19:37:58.054] [ERROR] Error: getaddrinfo ENOTFOUND fly-fc-redis.upstash.io
2023-02-20T19:37:58Z [info] at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26)
2023-02-20T19:37:58Z [info] at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17)