# cannot connect to valkey/redis

**URL:** <https://community.fly.io/t/cannot-connect-to-valkey-redis/25264>\
**Category:** General\
**Tags:** redis, login-only\
**Created:** [July 1, 2025, 8:47pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264 "2025-07-01T20:47:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![miker](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/miker/32/47277_2.png) [@miker](https://community.fly.io/u/miker)\
**Post date:** [July 1, 2025, 8:47pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/1 "2025-07-01T20:47:35Z")

</div>

My app is unable to connect to a separate valkey instance.

DNSException:  
[info] syscall: “getaddrinfo”,  
[info] errno: 4,  
[info] code: “ENOTFOUND”

I can nslookup the .internal domain, no problem. I can also fly proxy without issue.

This used to work, and then it stopped working after a fresh deploy.

My apps have now stopped working as a result.

Region is AMS.

Please help.

---

<div class="post-metadata">

**Author:** ![miker](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/miker/32/47277_2.png) [@miker](https://community.fly.io/u/miker)\
**Post date:** [July 1, 2025, 8:50pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/2 "2025-07-01T20:50:16Z")

</div>

Reference: [fly machine cannot find upstash redis server](https://community.fly.io/t/fly-machine-cannot-find-upstash-redis-server/25106)

So Upstash also has this problem?

---

<div class="post-metadata">

**Author:** ![mayailurus](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/mayailurus/32/17593_2.png) [@mayailurus](https://community.fly.io/u/mayailurus)\
**Post date:** [July 1, 2025, 9:08pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/3 "2025-07-01T21:08:32Z")

</div>

> [@miker](#):
>
> So Upstash also has this problem?

That older post mentions IORedis, which has an IPv6 gotcha:

> [@ioredis only works with ipv6](https://community.fly.io/t/ioredis-only-works-with-ipv6/25013/1):
>
> I just solved a ioredis issue with this
> 
> ```auto
> export const redisClient = new Redis(env.REDIS_URL, {
> maxRetriesPerRequest: null,
> enableReadyCheck: false,
> family: 6
> });
> 
> ```
> 
> which seems to an old problem.

That doesn’t sound the same as your own situation, though, since yours would have been failing all along. (Unless you did just modify that section of the code.)

---

<div class="post-metadata">

**Author:** ![miker](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/miker/32/47277_2.png) [@miker](https://community.fly.io/u/miker)\
**Post date:** [July 1, 2025, 9:13pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/5 "2025-07-01T21:13:20Z")

</div>

> [@mayailurus](#):
>
> That post mentions IORedis, which has an IPv6 gotcha:

I mentioned Upstash as the OP did.

> [@mayailurus](#):
>
> Unless you did just modify that section of the code.

I hadn’t changed anything. Most recent deployment was three months ago. I made a minor adjustment to something unrelated, and then this issue surfaced.

I’ll try play with the config.

---

<div class="post-metadata">

**Author:** ![miker](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/miker/32/47277_2.png) [@miker](https://community.fly.io/u/miker)\
**Post date:** [July 1, 2025, 9:19pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/6 "2025-07-01T21:19:08Z")

</div>

Thanks, above worked. Very strange if it’s an old issue (previous deployment wasn’t too long ago).

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/fly1/original/3X/6/e/6e8955d00cb218e186ebbe3a6ab06fefdce15290.svg) [@system](https://community.fly.io/u/system)\
**Post date:** [July 8, 2025, 9:19pm UTC](https://community.fly.io/t/cannot-connect-to-valkey-redis/25264/7 "2025-07-08T21:19:38Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
