You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.]
The text was updated successfully, but these errors were encountered:
@arunsingh28 Is password your password? if not, just a note, on my end I have the same issue because = is in my password and for some reason it doesn't send it properly. I think it encodes special characters and doesn't remove the encoding before connecting. I noticed the same issue in ioredis library. Hope it helps.
UPDATE
Nevermind, I had 2 clients connecting using the same credentials and one didn't pass the correct password.
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
here I'm firing the server
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
The text was updated successfully, but these errors were encountered: