question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug from 8f62f16: Unix domain socket; ERR invalid DB index

See original GitHub issue
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.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

2reactions
rigelkcommented, May 21, 2018

would it be possible to merge this @behrad ? I’ve had the patch in production for some time now, without any issue to report.

0reactions
sarneehcommented, Oct 19, 2018

Oh, didn’t notice the PR, my bad!

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 ...
Read more >
Redis - ERR invalid DB index when running rspec
The problem was that I needed to increase the number of databases. To do so, I went to /usr/local/etc and modified redis.conf ....
Read more >
Unix domain socket server returns error 95! - Google Groups
Running such a 'server' works fine on Digital Unix and ULTRIX. However running the server on Linux gives the following error message: errno...
Read more >
Debugging the Invalid Descriptor Index Error - Nick Vasile
Specify the ODBC driver you downloaded in step 2 when connecting to your database. con <- DBI::dbConnect( odbc::odbc(), Driver = "ODBC Driver 17 ......
Read more >
How can we clear up this error which i am getting in SQL ...
Query Written in SQL Statement which was used and written in DB profile ... But, the title 'invalid column index' error usually means...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found