-
-
Notifications
You must be signed in to change notification settings - Fork 3
NOAUTH Authentication required #20
Comments
some additional information:
|
Just an update: adding PING didn't help, still getting same error from time to time (couple times per day). |
It seems the solution is, after all, to wait until the client connects and initializes. Maybe when I tried to solve this problem by adding a delay, delay was not big enough (it was 600ms). Currently, I am using the following function to connect to Redis: export function connectToCache() {
return new Promise((resolve, reject) => {
let connected = false;
const client = new ClientV2({ ... });
client.on("error", (e) => {
if (connected)
console.error("Redis error", e);
else
reject(e);
});
client.on("connect", () => {
connected = true;
resolve(client)
});
});
} usage is like this: const client = await connectToCache();
// do stuff with client and the "NOAUTH" error doesn't happen anymore for me. Even though the problem is now solved for me, I still think this issue needs to be addressed, since currently it is quite easy to use the client in incorrect way and start sending commands without waiting the client to connect. |
Environment
Describe the bug
From time to time, I'm getting this error:
To Reproduce
Code to reproduce the behavior:
Additional context
I think, what happens is:
It doesn't happen always, so probably it depends on the connection to redis server. Also, I am using SSL connection, SSL handshake also takes time.
The text was updated successfully, but these errors were encountered: