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

Connection handshake fails with ERR unknown command CLIENT, with args beginning with: SETINFO lib-name #2817

Closed
xsolo opened this issue Apr 4, 2024 · 8 comments · Fixed by #2823
Assignees
Milestone

Comments

@xsolo
Copy link

xsolo commented Apr 4, 2024

Bug Report

Current Behavior

The connection does not work and fails to connect to Google Cloud Redis (Memory Store) v7.2 with the following error CLIENT 'SETINFO'. The Client Setinfo not supported by GCP Redis

Stack trace
Exception in thread "main" io.lettuce.core.RedisConnectionException: Unable to connect to IP_ADDRESS/<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:215)
	at io.lettuce.core.RedisClient.connect(RedisClient.java:200)
	at com.wayfair.smart.ds587.demo.bt.graphql.RedisTest.main(RedisTest.java:29)
Caused by: io.lettuce.core.RedisCommandExecutionException: ERR unknown command 'CLIENT', with args beginning with: 'SETINFO' 'lib-name' 'Lettuce'
	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:745)
	at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:680)
	at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:597)
	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:509)
	at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407)
	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)
	at java.base/java.lang.Thread.run(Unknown Source)

Input Code

Input Code
// your code here;

Expected behavior/code

Environment

  • Lettuce version(s): 6.3.2.RELEASE
  • Redis version: Google Cloud Redis (Memory Store) v7.2

Possible Solution

Additional context

@mp911de
Copy link
Collaborator

mp911de commented Apr 9, 2024

Have you tried to disable the Client Info via RedisURI.setLibraryName(null)/RedisURI.setLibraryVersion(…)?

The issue with Redis derivatives is that they pretend a specific version that we use to control whether certain functionality is available while the derivative server software doesn't implement the Redis OSS functionality we're looking for.

@mp911de mp911de changed the title Unable to connect to IP_ADDRESS/<unresolved>:6379 Connection handshake fails with ERR unknown command CLIENT, with args beginning with: SETINFO lib-name Apr 9, 2024
@mp911de mp911de added this to the 7.x milestone Apr 10, 2024
@joexfactor
Copy link

Hi Team,

We are currently facing the same compatibility issue with Lettuce 6.3.2.RELEASE when connecting to Google Cloud Redis (Memory Store) v7.2, an issue that does not occur with the earlier v7.0. We are using Lettuce as a transitive dependency through org.springframework.boot:spring-boot-starter-data-redis:3.2.5.

Could you please provide any advice on potential solutions or workarounds for this issue? Additionally, any information on upcoming fixes or patches would be highly appreciated as it would help us plan our development and maintenance activities better.

@xsolo
Copy link
Author

xsolo commented Apr 30, 2024

Hi Team,

We are currently facing the same compatibility issue with Lettuce 6.3.2.RELEASE when connecting to Google Cloud Redis (Memory Store) v7.2, an issue that does not occur with the earlier v7.0. We are using Lettuce as a transitive dependency through org.springframework.boot:spring-boot-starter-data-redis:3.2.5.

Could you please provide any advice on potential solutions or workarounds for this issue? Additionally, any information on upcoming fixes or patches would be highly appreciated as it would help us plan our development and maintenance activities better.

I think this is what the reference ticket is about #2823

@tishun
Copy link
Collaborator

tishun commented Apr 30, 2024

Folks,

My bad. You can unblock yourself for now if you manually disable the reporting of the client name and version:

RedisURI redisUri = RedisURI.Builder.redis("my.redis.instance.com", 6379)
   .withLibraryName("")
   .withLibraryVersion("")
   .build();
RedisClient redisClient = RedisClient.create(redisUri);

This should unblock you until 6.4.0 is released and you are able to consume the solution in #2823

@markusheiden
Copy link

markusheiden commented Oct 21, 2024

Do you have a hint how to apply the workaround if using Spring Data?

@tishun
Copy link
Collaborator

tishun commented Oct 21, 2024

Do you have a hint how to apply the workaround if using Spring Data?

I assume you are not able to bump the version of the Lettuce driver to 6.4.0.RELEASE?

Have you tried the solution from spring-projects/spring-data-redis#2938 (comment) ?

@markusheiden
Copy link

First, thanks for the hints.

I assume you are not able to bump the version of the Lettuce driver to 6.4.0.RELEASE?

I could, but is that compatible with Spring Boot 3.3? I didn't dare to just update it.

Have you tried the solution from spring-projects/spring-data-redis#2938 (comment) ?

No, I already looked into that, but that is too much copy and paste for me. Instead of doing this, I prefer to wait for Spring Boot 3.4 before upgrading our Redis to 7.

@tishun
Copy link
Collaborator

tishun commented Nov 1, 2024

I could, but is that compatible with Spring Boot 3.3? I didn't dare to just update it.

My bad, I thought I saw a release of spring-data-redis consuming Lettuce 6.4.x
Seems it is still in the works.

No, I already looked into that, but that is too much copy and paste for me. Instead of doing this, I prefer to wait for Spring Boot 3.4 before upgrading our Redis to 7.

This is reasonable if you have the luxury to wait for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants