redis / redis/node-redis

ErrorReply: WRONGPASS invalid username-password pair or user is disabled.

Open
#2,857 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
TypeScript
Stars
17.6k
Forks
2k
Avg merge
2d 3h
Merged PRs (30d)
40

Description

Description

I'm encountering a persistent WRONGPASS invalid username-password pair or user is disabled error when trying to connect to a Redis server using the Node.js Redis client. Despite setting the correct password for the default user and verifying it works through the Redis CLI, the connection from the Node.js application continues to fail with the same error. I've followed standard procedures for setting and verifying the password, but the issue remains unresolved.

Note: Authentication works successfully through the Redis CLI, but when attempting to connect via the Node.js application, the WRONGPASS error is thrown.

Node code

import * as redis from "redis";
import { env } from "../../config/env";

const redisClient = redis.createClient({
  url: `${env.MODE === "dev" ? "redis://" : "rediss://"}${env.REDIS_URI}`,
  socket: {
    tls: env.MODE !== "dev",
  },
});

redisClient.on("connect", () => {
  console.log(
    env.MODE === "dev" ? "connected to local redis" : "connected to AWS Valkey caches"
  );
});

redisClient.on("error", (err) => {
  console.log("error connecting to redis", err);
});

export default redisClient;

here I'm firing the server

import App from "./src/app";
import MongoDB from "./src/services/database";
import RedisClient from "./src/services/redis";

import { env } from "./config/env";

const { port } = env;

App.server.listen(port, async () => {
  MongoDB.connectDB();
  await RedisClient.connect();
  console.log(`server listening on port ${port}`);
});

this is my REDIS_URI=default:password@localhost:6379

Node.js Version

18.0.0

Redis Server Version

4.7.0

Node Redis Version

4.7.0

Platform

macOS

Logs
error connecting to redis [ErrorReply: WRONGPASS invalid username-password pair or user is disabled.]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the shown redis.createClient configuration and RedisClient.connect call, then compare the REDIS_URI value with the Redis CLI authentication setup and the dev/TLS branches. Done means the cause of the WRONGPASS response is identified and a reproducible configuration or client fix is recorded.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, redis, typescript
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.