ERR DB index is out of range Redis Origin: Data OSI layer 7 · Application Last updated 5 Nov 2026

Redis: (error) ERR DB index is out of range / ERR SELECT is not allowed in cluster mode

SELECT n used a database number the server doesn't have, or you're on Redis Cluster/managed Redis that only has DB 0.

Exact message you may see ERR DB index is out of range(error) ERR DB index is out of rangeERR SELECT is not allowed in cluster modeReplyError: ERR DB index is out of rangeredis.exceptions.ResponseError: DB index is out of range
Seen on: Redis Node.js

Meaning

Default is 16 databases (databases 16); increase in redis.conf if needed. Redis Cluster supports only DB 0 and rejects SELECT. Some managed services limit DBs. Many frameworks default to DB 1+ in URLs (redis://host/5): use DB 0 or namespaced keys instead.

Common causes

  • DB number ≥ databases setting
  • Redis Cluster or provider with a single database
  • redis://host/5 URL pointing to a non-existent DB
  • Config change after restart
  • Proxy (Envoy, Twemproxy) limiting SELECT

⚡ Quick fix

  1. Use DB 0 and key prefixes for separation
  2. Raise databases in redis.conf
  3. Remove the /N suffix from the URL for Cluster/managed services

Detailed fix by platform

Linux

  1. redis-cli CONFIG GET databases; redis-cli -n 3 ping

How to diagnose

  1. DB number — Within range?
  2. Mode — Cluster?
  3. URL — Suffix?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

Can't connect to Redis from another host (bind 127.0.0.1) — Redis: Could not connect to Redis at 10.0.0.5:6379: Connection timed out (Redis)Can't connect to Redi…ERR CONFIG SET failed (possibly related to argument) — Redis: (error) ERR CONFIG SET failed (possibly related to argument 'maxmemory') - can't set immutable config (Redis)ERR CONFIG SET failed…ERR This instance has cluster support disabled — Redis: (error) ERR This instance has cluster support disabled (Redis)ERR This instance has…ERR wrong number of arguments / syntax error — Redis: (error) ERR wrong number of arguments for 'set' command / ERR syntax error (Redis)ERR wrong number of a…MOVED / ASK redirection (non-cluster client) — Redis: (error) MOVED 3999 10.0.0.6:6379 / ReplyError: MOVED 12182 192.168.0.5:7001 (Redis)MOVED / ASK redirecti…Redis closes idle clients (timeout setting) — Redis: Closing idle client / Connection closed by server after timeout 300 (Redis)Redis closes idle cli…Redis fails to start: Address already in use / Bad directive in config — Redis: # Could not create server TCP listening socket *:6379: bind: Address already in use / *** FATAL CONFIG FILE ERROR *** (Redis)Redis fails to start:…Redis::CannotConnectError (Sidekiq/Rails) — Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Ruby / Rails)Redis::CannotConnectE…ERR DB in…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.