Automattic / Automattic/kue

[createClientFactory] Trying to connect to localhost when using createClientFactory

Open
#882 5 comments 0 reactions 0 assignees View on GitHub
Bug Question
Dominant language
JavaScript
Stars
9.4k
Forks
858
PR merge metrics
No merged PRs in 30d

Description

Kue is trying to make a connect to localhost after I have successfully connected to a non-localhost redis server.

```
events.js:141
throw er; // Unhandled 'error' event
^

Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED 127.0.0.1:6379
at Object.exports._errnoException (util.js:870:11)
at exports._exceptionWithHostPort (util.js:893:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
```

This happens after I successfully connect to my redis server (which does not sit on localhost).

My dependencies:

```
├── kue@0.10.5
├── kue-ui@0.1.0
├── redis@2.6.0-1
```

I am using node-redis has my redisClient:

```

app.redisClient = redis.createClient(config.redis.port, config.redis.host);
app.jobs = kue.createQueue({
redis: {
createClientFactory: function () {
return app.redisClient;
}
},
disableSearch: true
});
```

Is Kue trying to make another connection for another feature that I am not across?

Cheers,
Peter

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the kue.createQueue redis option and trace how createClientFactory uses the redis.createClient instance when connecting to a non-localhost server. Reproduce the supplied configuration and confirm that creating the queue does not attempt an additional connection to 127.0.0.1:6379.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.