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
NOAUTH Authentication required #1543
Comments
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it and, ideally, providing a minimal sample that reproduces the problem. Attaching the debug log is also a good option. |
@mp911de I solved it by manually specifying RESP2 RedisClient redisClient = RedisClient.create(RedisURI.Builder.redis("x.x.x.x", 6379).withPassword("laosiji123".toCharArray()).withDatabase(6).build());
redisClient.setOptions(ClientOptions.builder().protocolVersion(ProtocolVersion.RESP2).build()); lettuce 5.x -> cloud server redis |
Thanks for the report. Lettuce 6 tries to auto-discover the protocol. If Redis responds with |
Here is the best practice with spring boot package com.chinaroad.parking.config;
import io.lettuce.core.ClientOptions;
import io.lettuce.core.protocol.ProtocolVersion;
import org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
@Configuration
public class SpringConfig implements LettuceClientConfigurationBuilderCustomizer {
@Override
public void customize(LettuceClientConfiguration.LettuceClientConfigurationBuilder clientConfigurationBuilder) {
// manually specifying RESP2
clientConfigurationBuilder.clientOptions(ClientOptions.builder()
.protocolVersion(ProtocolVersion.RESP2)
.build());
}
} |
Bug Report
Current Behavior
Connect to the low version of redis, prompt NOAUTH Authentication required.
Stack trace
Caused by: io.lettuce.core.RedisCommandExecutionException: NOAUTH Authentication required. at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:137) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.internal.ExceptionFactory.createExecutionException(ExceptionFactory.java:110) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:120) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.CommandWrapper.complete(CommandWrapper.java:59) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.CommandHandler.complete(CommandHandler.java:704) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:639) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:560) ~[lettuce-core-6.0.0.RELEASE.jar:6.0.0.RELEASE] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493) ~[netty-transport-4.1.54.Final.jar:4.1.54.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989) ~[netty-common-4.1.54.Final.jar:4.1.54.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.54.Final.jar:4.1.54.Final] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[netty-common-4.1.54.Final.jar:4.1.54.Final] ... 1 common frames omittedInput Code
Input Code
Expected behavior/code
Environment
Possible Solution
Additional context
The text was updated successfully, but these errors were encountered: