Bug from 8f62f16: Unix domain socket; ERR invalid DB index
var kue = require('kue');
kue.createQueue({
redis: {
socket: '/path/to/redis_sock',
},
});
throws an unhandled exception: "ReplyError: ERR invalid DB index"
This is due to changes in lib/redis.js introduced in 8f62f16:
Line 114: var db = !socket ? (options.redis.db || 0) : null;
Line 119-121: if( db >= 0 ){ client.select(db); }
Since (null >= 0) === true , client.select(null) will be run when initiating the redis connection over a socket path, resulting in the mentioned error. I made the pull request #999 a while back to fix this. A similar solution would be to change line 114 to var db = !socket ? (options.redis.db || 0) : undefined; but I was not sure if setting to undefined would be accepted as it seems to go against the programming style. If you prefer db = undefined, let me know and I'll amend my PR.
When I submitted this pull request, I was mistakenly thinking, that #396 was referencing the same issue, now I realize that the bug was not introduced until October 2015. Please merge this request, as unix domain sockets are quite useful on shared hosting environments.
I am stuck with the same problem, has there been a resolution to this?
would it be possible to merge this @behrad ? I've had the patch in production for some time now, without any issue to report.
Would be lovely to see this issue resolved. @rigelk if you have a patch why don't you provide a pull request here?
@seanosh PR #999 has it, but for some reason isn't merged.
Hi there. I appreciate any help in moving this forward. Please note that the Travis CI checks failed due to an issue with how the tests are written. Simon
Oh, didn't notice the PR, my bad!