redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
124 stars 60 forks source link

NOAUTH even when valid username and password presented. #201

Closed davidsiaw closed 4 months ago

davidsiaw commented 4 months ago

I upgraded sidekiq and it pulled in redis-client 0.22.2 and stopped using redis library and started getting NOAUTH errors. At the console this happened:

irb(main):075* rc = RedisClient.new({
irb(main):076*   url: 'redis://app:pass@redis:14624'
irb(main):079> })
irb(main):082> rc.call("GET", "key")
(irb):82:in `<main>': ERR unknown command 'hello' (redis://redis:14624) (RedisClient::CommandError)
irb(main):083> rc.call("GET", "key")
(irb):83:in `<main>': NOAUTH Authentication required (redis://redis:14624) (RedisClient::CommandError)
irb(main):084> r = Redis.new({  url: 'redis://app:pass@redis:14624'})
irb(main):085>
=> #<Redis client v4.8.1 for redis://redis:14624/0>
irb(main):086> r.call('get','key')
=> nil
irb(main):087> exit

Unsure but maybe something to do with Redis version Redis 7.2.3

old Redis client still worked so this is a breakage in my view.

byroot commented 4 months ago

ERR unknown command 'hello'

This means that either your Redis server is too old (need to be 6+) or that there is some proxy in front that doesn't understand RESPv3 (very often it's envoy).

davidsiaw commented 4 months ago

The redis server is 7.2.3, and there is no proxy. Is there a requirement for RESPv3?

byroot commented 4 months ago

The HELLO command was added in 6.0: https://redis.io/docs/latest/commands/hello/

So whatever the problem is, it's not with redis-client

davidsiaw commented 4 months ago

Issue here isn't the HELLO but that was surprising too. The main issue is the NOAUTH. A valid username and password was presented (as mentioned in the title)

davidsiaw commented 4 months ago

I understand this is not a support forum, I am just notifying you of breakage, but you are free to ignore it.

byroot commented 4 months ago

The NOAUTH error you get is the result of the HELLO command missing.

And there is no breakage, thousands and thousands of people, me included, are using the library with required username and password. I closed the issue because the problem is with your Redis server, not with redis-client.