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

LettuceConnectionFactory is not establishing the connection when using a Japanese username and password #3071

Open
ganeshgudaghe opened this issue Dec 9, 2024 · 3 comments · May be fixed by #3075
Labels
status: mre-available Minimal Reproducible Example is available type: bug A general bug
Milestone

Comments

@ganeshgudaghe
Copy link

ganeshgudaghe commented Dec 9, 2024

Hi,

I deployed Redis using a Japanese username and password, and when I try to make a connection from Spring Boot's LettuceConnectionFactory, it fails to establish a connection with the following error:

"Caused by: io.lettuce.core.RedisCommandExecutionException: WRONGPASS invalid username-password pair or user is disabled."

Even though I am using the correct username and password, I am able to connect using other tools like RedisInsight, but the issue is only with LettuceConnectionFactory.

                <dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-redis</artifactId>
			<version>2.7.8</version>
		</dependency>

Below is my code:
userName="日本語"
password="日本語"
java
Copy code

@Bean
public LettuceConnectionFactory lettuceConnectionFactory() {
    var config = new RedisStandaloneConfiguration(host, Integer.parseInt(port));
    var clientConfig = LettuceClientConfiguration.builder().build();
    config.setUsername(userName);
    config.setPassword(RedisPassword.of(password));
    return new LettuceConnectionFactory(config, clientConfig);
}

I also tried using UnifiedJedis, and it works fine:

java
Copy code

HostAndPort config = new HostAndPort(host, port);
UnifiedJedis jedisClient = new UnifiedJedis(
    new PooledConnectionProvider(config, DefaultJedisClientConfig.builder().user(userName)
        .password(password).build()),
    maxAttempts, maxRetriesDuration);
@tishun tishun added for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-triage status: mre-available Minimal Reproducible Example is available labels Dec 9, 2024
@ganeshgudaghe
Copy link
Author

@tishun could you please help me here to resolve this issue ?

@tishun
Copy link
Collaborator

tishun commented Dec 11, 2024

Hey @ganeshgudaghe ,

I've reproduced the issue you are having. Seems that Lettuce is not handling these characters in a good way.
We need to prepare a fix and release it. For now I do not have a good workaround for you unfortunately (other than using english characters for username and password)

@tishun tishun added type: bug A general bug and removed for: team-attention An issue we need to discuss as a team to make progress status: waiting-for-triage labels Dec 11, 2024
@tishun tishun added this to the 6.5.2.RELEASE milestone Dec 12, 2024
@tishun tishun linked a pull request Dec 12, 2024 that will close this issue
4 tasks
@ganeshgudaghe
Copy link
Author

Thanks @tishun

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: mre-available Minimal Reproducible Example is available type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants