This repository was archived by the owner on May 23, 2022. It is now read-only.
Description 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:
I initialize the client - it starts connecting to the Redis server
I start doing my stuff, and run some redis commands (before connection is established) - these go to the buffer
Connection to server is established, authentication command is issued
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.