Redis failing to connect with `ECONNREFUSED`
Hi team, today our apps started getting the error when trying to connect with our redis instance:
We've read through a couple threads and tried the following:
1. We are using private redis, so we've ensured we have family=0 set on the connections
2. We tried switching to the public connection. We're able to connect and run on app with the public connection locally, but we still get errors in prod.
We're using ioredis with the following settings:
This was working for us until today
Solution:Jump to solution
yea
ioredis
's Redis class claims that it can be constructed by passing an object with the connection options as follows:
```ts
import Redis from 'ioredis'
...7 Replies
Project ID:
d5830106-c562-4490-bfe0-6636a0c4a844
d5830106-c562-4490-bfe0-6636a0c4a844
ECONNREFUSED 127.0.0.1:6379
the redis client is trying to connect to what would be its default options, please make sure you have the client config setup correctlyThanks we found and resolved the issue
awsome, do you mind sharing it?
Solution
yea
ioredis
's Redis class claims that it can be constructed by passing an object with the connection options as follows:
Or by passing the connection url as follows:
We had recently switched to the first approach and that seemed to have broke things. Switching back to the second syntax did the trickperfect, thanks for the explanation!