redis / lettuce

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
https://lettuce.io
MIT License
5.41k stars 975 forks source link

io.lettuce.core.protocol.RedisProtocolException: Invalid first byte: 57 (9) at buffer index 56910 decoding using RESP3 #2585

Open puneet1992 opened 10 months ago

puneet1992 commented 10 months ago

Getting the above error with lettuce 6.3.0.RELEASE. here is the complete stack trace.

Connection failed to Redis pubsub node RedisNode(host=antelope-rtm-load-cluster.2ouka2.clustercfg.use1.cache.amazonaws.com, port=6379, password=, isSSLEnabled=false) 
io.lettuce.core.protocol.RedisProtocolException: Invalid first byte: 57 (9) at buffer index 56910 decoding using RESP3
    at io.lettuce.core.protocol.RedisStateMachine.readReplyType(RedisStateMachine.java:612)
    at io.lettuce.core.protocol.RedisStateMachine.doDecode(RedisStateMachine.java:330)
    at io.lettuce.core.protocol.RedisStateMachine.decode(RedisStateMachine.java:300)
    at io.lettuce.core.protocol.CommandHandler.decode0(CommandHandler.java:813)
    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:786)
    at io.lettuce.core.protocol.CommandHandler.decode(CommandHandler.java:630)
    at io.lettuce.core.pubsub.PubSubCommandHandler.decode(PubSubCommandHandler.java:112)
    at io.lettuce.core.protocol.CommandHandler.channelRead(CommandHandler.java:597)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:795)
    at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:475)
    at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:378)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    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:832)

Environment Lettuce version(s): 6.3.0.RELEASE Redis version: Redis 7.1.0

puneet1992 commented 10 months ago

@mp911de Is it possible for you to provide some inputs here?

mp911de commented 10 months ago

Without context, a wire trace or a way to reproduce, I'm not able to diagnose what's going on.

zulker01 commented 10 months ago

I am facing similar issue . Error message is the same as this https://github.com/redis/lettuce/issues/1796.

I am using several microservices. Each one validates requests through bearer token . Redis and Lettuce is used in User-Service , for saving and fetching renew token for a user . As , this issue is not regular, we get this once in a while, So even I don't know how to regenerate this issue. I am guessing this maybe because of high amount of requests .

Please let me know how to solve this

puneet1992 commented 10 months ago

@mp911de We are using Redis pubsub (aws elasticate nodes with cluster mode disabled) for publishing/subscribing. now we are trying to move to the cluster mode enabled one to achieve default autoscaling provided by AWS. the cluster is going into a modifying state we are getting the above errors. currently, i'm using lettuce 6.3.0 RELEASE for this testing.

mp911de commented 10 months ago

Please let me know how to solve this

https://github.com/lettuce-io/lettuce-core/issues/2585#issuecomment-1884374064