Skip to content

NOAUTH Authentication required when REDIS_URL is set with password #442

Closed

Description

@yujinio

Scenario
Users might want to protect their connection to Redis by setting the --requirepass option in Redis. With this option, users will need to use the ?password= parameter/option when using any client to connect to Redis instance.

Expected behavior
When user sets REDIS_URL to something like redis://redis:6379?password=SOMEPASSWORDHERE, the password gets propagated to the Redis client as one of the options.

Current behavior
When I set the REDIS_URL with a ?password= parameter, this parameter doesn't get taken into account because current implementation doesn't support Redis options, i.e. current implementation seems to only be taking the URL and nothing else. Instead, I get the NOAUTH Authentication required. exception (see logs below).

The logs:

[ioredis] Unhandled error event: ReplyError: NOAUTH Authentication required.
    at parseError (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:302:14)
ReplyError: NOAUTH Authentication required.
    at parseError (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:302:14) {
  command: { name: 'info', args: [] }
}
ReplyError: NOAUTH Authentication required.
    at parseError (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:302:14) {
  command: { name: 'info', args: [] }
}
ReplyError: NOAUTH Authentication required.
    at parseError (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:179:12)
    at parseType (/app/node_modules/.pnpm/[email protected]/node_modules/redis-parser/lib/parser.js:302:14) {
  command: { name: 'info', args: [] }

Activity

  1. locked and limited conversation to collaborators on Oct 28, 2024
  2. converted this issue into a discussion #443 on Oct 28, 2024
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions