Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connecting to a sentinel Redis 5.0.7 fails with NOAUTH Authentication required #1391

Closed
kalyashov opened this issue Aug 14, 2020 · 3 comments
Labels
status: waiting-for-feedback We need additional information before we can continue type: bug A general bug

Comments

@kalyashov
Copy link

kalyashov commented Aug 14, 2020

I am trying to connect to the sentinel node of a Redis and I am getting the error:

Caused by: io.lettuce.core.RedisConnectionException: null
	at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:75) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]
	at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]
	at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:242) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]
	at com.redislabs.lettusearch.RediSearchClient.connect(RediSearchClient.java:101) ~[lettusearch-2.3.2.jar:na]
	at com.redislabs.lettusearch.RediSearchClient.connect(RediSearchClient.java:94) ~[lettusearch-2.3.2.jar:na]
	at ru.vtb.payments.catalog.config.datasouce.RedisConfig.rediSearchReactiveCommands(RedisConfig.kt:27) ~[main/:na]
	at ru.vtb.payments.catalog.config.datasouce.RedisConfig$$EnhancerBySpringCGLIB$$7f1572ea.CGLIB$rediSearchReactiveCommands$1(<generated>) ~[main/:na]
	at ru.vtb.payments.catalog.config.datasouce.RedisConfig$$EnhancerBySpringCGLIB$$7f1572ea$$FastClassBySpringCGLIB$$173fceee.invoke(<generated>) ~[main/:na]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) ~[spring-core-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	at ru.vtb.payments.catalog.config.datasouce.RedisConfig$$EnhancerBySpringCGLIB$$7f1572ea.rediSearchReactiveCommands(<generated>) ~[main/:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
	at java.base/java.lang.reflect.Method.invoke(Method.java:564) ~[na:na]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ~[spring-beans-5.2.7.RELEASE.jar:5.2.7.RELEASE]
	... 82 common frames omitted
Caused by: io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required.  
	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:135) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]
	at io.lettuce.core.ExceptionFactory.createExecutionException(ExceptionFactory.java:108) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]
	at io.lettuce.core.RedisPublisher$SubscriptionCommand.complete(RedisPublisher.java:764) ~[lettuce-core-5.3.3.RELEASE.jar:5.3.3.RELEASE]

docker-compose.yml to launch redis containers:

version: '2'

networks:
  app-tier:
    driver: bridge

services:
  redis:
    image: 'redislabs/redisearch:latest'
    environment:
      - REDIS_PASSWORD=12345678
    ports:
      - '6379:6379'
    networks:
      - app-tier
  redis-sentinel:
    image: 'bitnami/redis-sentinel:latest'
    environment:
      - REDIS_MASTER_HOST=127.0.0.1
      - REDIS_MASTER_PASSWORD=12345678
      - REDIS_SENTINEL_PASSWORD=12345678
    ports:
      - '26379:26379'
    networks:
      - app-tier

The settings in the spring-boot app to connect Redis:

  redis:
    port: 6379
    database: 0
    host: localhost
    mutex-timeout: 300s
    command-timeout: 10s
    sentinel:
      master: mymaster
      nodes: 127.0.0.1:26379
      password: 12345678
    password: 12345678

I see that the redisURI is formed correctly
image

The password to Redis is correct:
image
I checked that the password to Redis is correct and also when I configure sentinel Redis without password there are no connection errors.

I see similar issues:

@kalyashov kalyashov added the type: bug A general bug label Aug 14, 2020
@mp911de
Copy link
Collaborator

mp911de commented Aug 14, 2020

Are you able to reproduce the same issue with using plain Lettuce code? Looking at the stack trace, lettusearch seems involved. Please also check that the sentinels property (containing RedisURI objects) is associated as well with the password.

@mp911de mp911de added the status: waiting-for-feedback We need additional information before we can continue label Aug 14, 2020
@kalyashov
Copy link
Author

@mp911de I checked that RedisURI in sentintels contains password too.
image

@kalyashov
Copy link
Author

A bug in com.redislabs.lettusearch.RediSearchClient so I close this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-feedback We need additional information before we can continue type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants