Redis::CommandError: ERR Client sent AUTH, but no

2019-04-21 17:03发布

问题:

This has to be some wrong config

I installed redis on localhost.

When trying to connect to it through Rails console

Redis.new(:host => 'localhost', :port => 6379)

I can't send commands and I get

Redis::CommandError: ERR Client sent AUTH, but no password is set

I don't recall setting a password, nor do I know where to see if a password has been set

if I use a different URL (like rediscloud or redistogo) I can send commands (setting the password accodingly)

From what I understand the error says that I am sending a password, but redis doesn't have a password. But, as you can see, I am not setting any password..

Is there a way to debug this?

回答1:

You can debug you client's communication from Redis' side by using the MONITOR command. MONITOR provides a stream of the commands that Redis processes, so if your Ruby client issues and uncalled-for AUTH you'll be able to catch it there.



回答2:

I got same Issue and it was that am trying to connect while no password had been set on radis server and my code was sending the pass as null

edit redis.conf and setting a password fix it

requirepass pass_here