Skip to content
This repository was archived by the owner on May 23, 2022. It is now read-only.
This repository was archived by the owner on May 23, 2022. It is now read-only.

NOAUTH Authentication required #20

@andrei-markeev

Description

@andrei-markeev

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.

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