Skip to content

Add redis sentinel password property #21353

Closed
@mcanessa

Description

@mcanessa

Spring boot version: 2.2.6.RELEASE
I get the RedisCommandExecutionException: NOAUTH Authentication required. After setting the configuration like this:

spring:
  cache:
    cache-names: mycache
    type: redis
  redis:
    password: mypassword
    sentinel:
      master: mymaster
      password: mypassword
      nodes: myredis01:26379,myredis02:26379,myredis03:2637{code}

I tried setting only spring.redis.password, only spring.redis.sentinel.password and both at the same time and it's not working.

Digging through the code I found that the sentinel password is never set on the configuration:

1- org.springframework.boot.autoconfigure.data.redis.RedisProperties.Sentinel doesn't have the 'password' property.
2- org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration#getSentinelConfig() never sets the existing property 'sentinelPassword' in RedisSentinelConfiguration.
3 - Resulting in the org.springframework.data.redis.connection.lettuce.LettuceConverters setting always a null password which is the default when not set in the sentinelConfigurationToRedisURI method.

So the problem comes when the sentinel is also password protected. I mistakenly filed the bug on the Spring redis data and they sent me here.

regards,

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions