ERR client sent AUTH, but no password set

I am using jedis 2.8.0 and am getting the following exception:

Caused by: redis.clients.jedis.exceptions.JedisDataException: ERR Client sent AUTH, but no password is set
        at redis.clients.jedis.Protocol.processError(Protocol.java:123)
        at redis.clients.jedis.Protocol.process(Protocol.java:157)
        at redis.clients.jedis.Protocol.read(Protocol.java:211)
        at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
        at redis.clients.jedis.Connection.getStatusCodeReply(Connection.java:196)
        at redis.clients.jedis.BinaryJedis.auth(BinaryJedis.java:2049)
        at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:89)
        at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:458)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
        at redis.clients.util.Pool.getResource(Pool.java:49)
        ... 4 more

      

Below is the api I am using:

jedisPool = new JedisPool(jedisPoolConfig, host, port, IDLE_CONNECTION_TIMEOUT, authSecret); 

      

Notes:

  • I can successfully send redis commands using the exact same password using the redis-cli -a option.
  • I also typed the password in the logs to see if I was sending the wrong password, but the password passed to JedisPool is correct.
  • I've also tried "redis-cli monitor" to call redis, but I don't see any AUTH request.
+3


source to share


1 answer


Your instance Redis

does not have a password. The password sent using redis-cli -a

is simply ignored.

Now you can set a password on the redis instance. To do this, edit the redis configuration file, set the option requirepass

and restart the redis instance.



Or, just ignore the password option when dealing with redis. For example.

jedisPool = new JedisPool(jedisPoolConfig, host, port, IDLE_CONNECTION_TIMEOUT);

      

+6


source







All Articles