createClient trying to connect with localhost even though URL is for docker's redis instance
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.6k
- Forks
- 2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 40
Description
Description
I am trying to create a client with URL redis://${process.env.REDIS_HOST}:${process.env.REDIS_PORT}, and sending REDIS_HOST=rediss and REDIS_PORT=6379, but still it is trying to connect with localhost
redis is running in docker, tested the connection, its working
also have other instance ofioredisusing same connection, it is able to connect
Node.js Version
v19.6.0
Redis Server Version
7.0.5
Node Redis Version
4.6.4
Platform
Linux
Logs
web | Error: connect ECONNREFUSED 127.0.0.1:6379
web | at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
web | errno: -111,
web | code: 'ECONNREFUSED',
web | syscall: 'connect',
web | address: '127.0.0.1',
web | port: 6379
web | }
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the createClient call and inspect how the REDIS_HOST and REDIS_PORT environment values are assembled into the URL. Reproduce with Node.js v19.6.0, Redis 7.0.5, and node-redis 4.6.4, then verify that the client connects to the configured Docker Redis endpoint rather than localhost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, redis, typescript
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100