The redis-cli behaves differently in the way it handles an empty password when using the cli for standard operations vs cluster operations.
Install Redis w/ Cluster and no auth/password configured:
# redis-cli set foo bar
# redis-cli get foo
bar
# redis-cli --cluster check 127.0.0.1:6379
...
[OK] All 16384 slots covered.
However, if you set an empty password in the environ:
# export REDISCLI_AUTH=''
# redis-cli get foo
bar
# redis-cli --cluster check 127.0.0.1:6379
Node 127.0.0.1:6379 replied with error:
ERR Client sent AUTH, but no password is set
Consistency in the behavior would be ideal.
(Yes, I understand no auth is bad, but sometimes we can't control our customers/users and they may have legacy or backward-compatibility reasons for doing the bad things that they do ;) )
This issue exists on both Redis 5.0.x ~~and 6.0.1~~ (correction, I haven't tried on 6.0.1 yet)
Comment From: bsergean
Don't you need to 'unsetenv REDISCLI_AUTH' ? I think here you are setting it to the empty string which is different.
Comment From: stevelipinski
Yes, agreed - unsetting the env variable would work. However - this issue is more about the difference in the behavior of redis-cli treatment of an empty string for a "normal" client vs cluster operation. redis-cli in "normal" client works fine with REDISCLI_AUTH set to an empty string. But, not in --cluster command mode.
Comment From: huangzhw
-> /home/database/redis/bin $ ./redis-cli -p 7000 get foo
AUTH failed: ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
-> /home/database/redis/bin $ ./redis-cli --cluster check 127.0.0.1:7000
Node 127.0.0.1:7000 replied with error:
ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct?
It's fixed