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.
1 Like
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)
ahtcx
September 29, 2023, 8:04pm
3
I’m currently getting the same. Unsure how to resolve… None of the Redis instances I create via the Fly CLI have resolvable hostnames.
How are you testing whether the addresses are resolvable? That’s usually an issue with IPv6 support in your client.
ahtcx
September 30, 2023, 2:47pm
5
Ah yeah indeed that would explain why it doesn’t work locally, but I get the DNS issue as @bwoodlt posted on my deployed instance. Maybe a configuration setup with my image or node.js, though I don’t think I’m doing anything weird with it.
Actually maybe it’s something to do with this: Unhandled error event: Error: getaddrinfo ENOTFOUND - AWS ElasticCache · Issue #1576 · redis/ioredis · GitHub
I’ll have a look around, thanks for the heads up
1 Like
Hey @ahtcx I’m having the same issue. Were you able to find a solution?
ahtcx
October 27, 2023, 6:45am
7
opened 02:37PM - 05 May 22 UTC
Hey guys, did anyone have some issue like that to connect in the AWS ElasticCach… e in the ECS Container?
[ioredis] Unhandled error event: Error: getaddrinfo ENOTFOUND cursobeta-dev-elasticache-redis.ilg7lv.ng.0001.use1.cache.amazonaws.com
Looks like permision, right?
`const pubClient = new Redis({
host: process.env.AWS_REDIS_HOST,
port: 6379
});`
Adding ?family=6 to the connection string fixed it.