ReplyError: ERR invalid DB index
See original GitHub issueWhen using ioredis in Heroku using RedisToGo add-on, I get this error:
Unhandled rejection ReplyError: ERR invalid DB index
at ReplyParser._parseResult (/app/node_modules/ioredis/lib/parsers/javascript.js:56:14)
at ReplyParser.execute (/app/node_modules/ioredis/lib/parsers/javascript.js:174:20)
at Socket.<anonymous> (/app/node_modules/ioredis/lib/redis/event_handler.js:88:22)
at Socket.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:163:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:538:20)
Everything works fine on my local machine(OS X) and local redis. I’m testing this with free plan in RedisToGo.
I’m initializing ioredis(version 1.5.0) like this:
var redis = new Redis(process.env.REDIS_URL, {
retryStrategy: function(times) {
// Make reconnecting a bit more relaxed compared to default
var delay = Math.min(times * 100, 4000);
return delay;
}
});
- REDIS_URL in heroku is in format:
redis://redistogo:<secret>@<secret>.redistogo.com:<port>/
. - REDIS_URL in local is:
redis://127.0.0.1:6379
Do you have ideas of how to fix this? Redis works apparently correctly but my logs fill up with those exceptions and in general I’d like to get this resolved.
Issue Analytics
- State:
- Created 8 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
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 >Trailing slash in Redis URL causes invalid db number #1758
The trailing slash causes this error: ReplyError: ERR invalid DB index , I presume because the url parser does not check if the...
Read more >How many databases are included on a Heroku Redis server?
How many databases are included on a Heroku Redis server? Issue. Attempting to access a database index on a Heroku Redis server returns:...
Read more >Maximum number of DB in Redis - Google Groups
error message. redis> select 17 (error) ERR invalid DB index. It seems to me that Redis does not allow more than 17 databases...
Read more >redis caching does't working. - Statamic Forum
ConnectionException in AbstractConnection.php line 155: `SELECT` failed: ERR invalid DB index [tcp://127.0.0.1:6379] in ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By setting the database to 0 in the url:
redis://redistogo:<secret>@<secret>.redistogo.com:<port>/0
the issue goes away.This might be an bug in parsing urls with trailing slash. Quote from RedisToGo support: