Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2204

I upgraded spring boot to 3.1.1 version and I get this error from Redis NOAUTH HELLO must be called with the client

$
0
0

I recently upgraded my spring boot project to version 3.1.1, I configured the Redis like the following:

@Beanpublic ReactiveRedisConnectionFactory redisFirstConnectionFactory() {    var redisConf = new RedisStandaloneConfiguration();    redisConf.setHostName(host);    redisConf.setPort(port);    redisConf.setPassword(password);    redisConf.setDatabase(0);    return new LettuceConnectionFactory(redisConf,            LettuceClientConfiguration                    .builder()                    .commandTimeout(Duration.ofSeconds(10))                    .build());}@Beanpublic ReactiveStringRedisTemplate redisTemplate(ReactiveRedisConnectionFactory cf) {    return new ReactiveStringRedisTemplate(cf);}

But when I start the application I get the following Exception:

 2023-07-17 13:59:17,781 [boundedElastic-1] WARN  org.springframework.boot.actuate.data.redis.RedisReactiveHealthIndicator [,] - Redis health check failedorg.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.translateException(LettuceConnectionFactory.java:1602)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1533)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getNativeConnection(LettuceConnectionFactory.java:1358)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$SharedConnection.getConnection(LettuceConnectionFactory.java:1341)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getSharedReactiveConnection(LettuceConnectionFactory.java:1083)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:479)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory.getReactiveConnection(LettuceConnectionFactory.java:105)    at reactor.core.publisher.MonoSupplier.call(MonoSupplier.java:67)    at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:227)    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)    at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)    at java.base/java.lang.Thread.run(Thread.java:833)Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to localhost/<unresolved>:6379    at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:78)    at io.lettuce.core.RedisConnectionException.create(RedisConnectionException.java:56)    at io.lettuce.core.AbstractRedisClient.getConnection(AbstractRedisClient.java:350)    at io.lettuce.core.RedisClient.connect(RedisClient.java:216)    at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.lambda$getConnection$1(StandaloneConnectionProvider.java:112)    at java.base/java.util.Optional.orElseGet(Optional.java:364)    at org.springframework.data.redis.connection.lettuce.StandaloneConnectionProvider.getConnection(StandaloneConnectionProvider.java:112)    at org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory$ExceptionTranslatingConnectionProvider.getConnection(LettuceConnectionFactory.java:1531)    ... 14 moreCaused by: io.lettuce.core.RedisCommandExecutionException: NOAUTH HELLO must be called with the client already authenticated, otherwise the HELLO AUTH <user> <pass> option can be used to authenticate the client and select the RESP protocol version at the same time    at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:147)    at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:116)    at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120)    at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)    at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:63)    at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:747)    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:682)    at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:599)    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800)    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499)    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397)    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)    ... 1 more

I can connect to Redis with that password using RedisInsight.Redis version 6.2.6

If you need anything please tell me to add to question.


Viewing all articles
Browse latest Browse all 2204

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>