What Can I Do If a Lettuce 6.x Client Is Incompatible with My DCS Instance?
Symptom
When a Lettuce 6.x client is connected to a Proxy Cluster DCS Redis 4.x/5.x instance, the error message "NOAUTH Authentication required" is displayed.
Analysis
In Lettuce 6.x and later versions, the HELLO command of RESP3 (introduced in Redis 6.x) is used to determine the version adaptation. Instances of earlier versions that do not support the HELLO command may encounter compatibility issues. For these instances, you can specify the RESP2 mode (compatible with Redis versions 4 and 5) in Lettuce.
Solution
Add the following code to use RESP2 protocol for accessing Redis:
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()); } }
Client and Network Connection FAQs
- Does DCS Support Public Access?
- Troubleshooting Redis Connection Failures
- Does DCS Support Cross-VPC Access?
- Will I Be Charged for the EIP Used for Public Access to a DCS Redis Instance?
- Why Is "(error) NOAUTH Authentication required" Displayed When I Access a DCS Redis Instance?
- What Should I Do If Access to DCS Fails After Server Disconnects?
- Why Do Requests Sometimes Time Out in Clients?
- What Should I Do If an Error Is Returned When I Use the Jedis Connection Pool?
- How Do I Access a DCS Redis Instance Through Redis Desktop Manager?
- What If "ERR Unsupported CONFIG subcommand" is Displayed in SpringCloud?
- What Can I Do If I Fail to Access a DCS Instance Using Its Domain Name Address?
- Can I Access DCS Instances in a Local Environment?
- What Should Be Noted When Using Redis for Pub/Sub?
- Why Is Public Access of My DCS Redis Instance Unintentionally Disabled?
- What Can I Do If Error "Cannot assign requested address" Is Returned When I Access Redis Using connect?
- Connection Pool Selection and Recommended Jedis Parameter Settings
- What Can I Do If a Lettuce 6.x Client Is Incompatible with My DCS Instance?
- Should I Use a Domain Name or an IP Address to Connect to a DCS Redis Instance?
- Is the Read-only Address of a Master/Standby Instance Connected to the Master or Standby Node?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbotmore