redis icon indicating copy to clipboard operation
redis copied to clipboard

NOAUTH Authentication required

Open andrei-markeev opened this issue 2 years ago • 3 comments

Environment

  • Node version: v14.16.0
  • Redis Server version: 6.0.14
  • Redis protocol version: 2
  • Camaro Redis version: 2.4.0

Describe the bug

From time to time, I'm getting this error:

(node:5876) UnhandledPromiseRejectionWarning:
    Redis Reply Error: NOAUTH Authentication required.
        at Parser.parseSimpleError (C:\home\site\wwwroot\deps.js:382:14)
        at processTicksAndRejections (internal/process/task_queues.js:93:5)

To Reproduce

Code to reproduce the behavior:

const { ClientV2: Client } = require('@camaro/redis')
const client = new Client({
    host: "<remote redis server host>",
    password: "testpass"
});

async function test() {
    await client.SET('bar', 'bar')
    const reply = await client.GET('bar')
    console.log(reply) // 'bar'
}

test().then(() => process.exit(0));

Additional context

I think, what happens is:

  1. I initialize the client - it starts connecting to the Redis server
  2. I start doing my stuff, and run some redis commands (before connection is established) - these go to the buffer
  3. Connection to server is established, authentication command is issued
  4. Client starts sending the commands to the server - but first commands are those from the buffer

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.

andrei-markeev avatar Sep 22 '21 18:09 andrei-markeev