Skip to content

ReplyError: ERR invalid DB index #1113

Open

Description

@Janpot

Stumbled upon this when accidentally supplying invalid url 'redis://:localhost:6379' instead of 'redis://localhost:6379' as a connection string. But this connection string causes unhandled rejections in ioredis.

To reproduce:

const Redis = require('ioredis')
const redis = new Redis('redis://:localhost:6379')
redis.on('error', console.log)

This will result in

(node:47615) UnhandledPromiseRejectionWarning: ReplyError: ERR invalid DB index
    at parseError (/Users/janpotoms/Personal/redis-ui/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/Users/janpotoms/Personal/redis-ui/node_modules/redis-parser/lib/parser.js:302:14)
(node:47615) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:47615) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

node version: v13.13.0
ioredis version: 4.16.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions