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

spring boot 3.x 连接pika报错 Version must not be null #2957

Open
a8848504 opened this issue Nov 28, 2024 · 5 comments · May be fixed by #2989
Open

spring boot 3.x 连接pika报错 Version must not be null #2957

a8848504 opened this issue Nov 28, 2024 · 5 comments · May be fixed by #2989
Labels
☢️ Bug Something isn't working

Comments

@a8848504
Copy link

Is this a regression?

Yes

Description

用spring boot 2.x可以正常连接

Caused by: io.lettuce.core.RedisConnectionException: Unable to connect to 192.168.5.2/:51002
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 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:1776)
... 45 more
Caused by: java.lang.IllegalArgumentException: Version must not be null
at io.lettuce.core.internal.LettuceAssert.notNull(LettuceAssert.java:71)
at io.lettuce.core.RedisHandshake$RedisVersion.(RedisHandshake.java:333)
at io.lettuce.core.RedisHandshake$RedisVersion.of(RedisHandshake.java:362)
at io.lettuce.core.RedisHandshake.applyPostHandshake(RedisHandshake.java:249)
at io.lettuce.core.RedisHandshake.lambda$initialize$0(RedisHandshake.java:99)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.lettuce.core.RedisHandshake.lambda$tryHandshakeResp3$1(RedisHandshake.java:126)
at java.base/java.util.concurrent.CompletableFuture.uniWhenComplete(CompletableFuture.java:863)
at java.base/java.util.concurrent.CompletableFuture$UniWhenComplete.tryFire(CompletableFuture.java:841)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at io.lettuce.core.protocol.AsyncCommand.completeResult(AsyncCommand.java:122)
at io.lettuce.core.protocol.AsyncCommand.complete(AsyncCommand.java:111)
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:1407)
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:918)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:994)
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(Thread.java:840)

Please provide a link to a minimal reproduction of the bug

No response

Screenshots or videos

image

Please provide the version you discovered this bug in (check about page for version information)

No response

Anything else?

No response

@a8848504 a8848504 added the ☢️ Bug Something isn't working label Nov 28, 2024
@cheniujh
Copy link
Collaborator

cheniujh commented Nov 29, 2024

请问pika是使用的哪个版本呢?
可以尝试把codis用起来,看是否依旧有这个问题,让springboot去链接codis,看能否解决这个问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


May I ask which version of pika are you using?

@Nickeysoft
Copy link

使用 官方 Docker 部署的 3.5.3 版本,springboot 版本 3.3.5,同样出现这个问题

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


This problem also occurs when using version 3.5.3 deployed by official Docker and springboot version 3.3.5.

@pro-spild
Copy link
Collaborator

导致这个错误的原因是因为底层的Lettuce与Pika进行握手的时候,pika没有返回版本信息,导致握手失败。
image
目前已在pika unstable和3.5进行修复。
可以选择使用修改过后的Pika,也可以使用旧版本pika,将springboot 升级为3.4.1。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☢️ Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants