mojira.dev
MC-271325

Server attempts to send disconnect packets in the status phase

Clients invalidly handling their connection during the status phase will cause a SocketException to be thrown, which is handled by the ClientConnection#exceptionCaught method. This results in a clientbound/minecraft:disconnect packet with the message 'Internal Exception: (stringified error)'to be sent to the client. However, this packet doesn't exist in the status phase, so the server logs the following exception:

Error sending packet clientbound/minecraft:disconnect
io.netty.handler.codec.EncoderException: Sending unknown packet 'clientbound/minecraft:disconnect'

I would expect this exception to not be thrown as sending a disconnect packet with text during the status phase makes no sense, and the true error is with the client rather than the server.

Linked issues

Attachments

Comments 22

I attached log-2024-05-01.txt, it goes along with this packet capture file that was too large for me to upload: https://drive.google.com/file/d/1l1RAHCC_-rwh8S2B1PO3YecRxdpyFvO0/view?usp=sharing

 

The issue happens at the times

[21:55:41] packet 11267
[23:46:39] packet 14259
[00:11:10] packet 14940
[00:13:02] packet 14990
[02:41:30] packet 18900
[04:47:41] packet 22144
[05:33:36] packet 23300

Affects 24w20a.

Affects 24w21b.

Affects 1.21 Pre-release 2.

Seems like this is breach attempt from old exploit. When older version, you might observed log that says something like <known player> disconnected from <not matching IP address>.

Seems like this is some kind of side effect of patching that exploit (or just updating java version). I experienced server crash when server processing these kind of errors.

12 more comments

Happening on Fabric 1.21.6 for me too.
[11:04:34] [Server thread/INFO]: [USERNAME] left the game
[11:05:34] [Server thread/INFO]: Server empty for 60 seconds, pausing
[12:19:30] [Netty Server IO #11/ERROR]: Error sending packet clientbound/minecraft:disconnect
io.netty.handler.codec.EncoderException: Sending unknown packet 'clientbound/minecraft:disconnect'
at knot/net.minecraft.class_9136.method_56426(class_9136.java:50) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_9136.encode(class_9136.java:14) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2545.method_10838(class_2545.java:26) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2545.encode(class_2545.java:12) ~[server-intermediary.jar:?]
at knot/io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.118.Final.jar:?]
at knot/net.minecraft.class_2535$2.write(class_2535.java:525) ~[server-intermediary.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:956) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:982) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:950) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:1000) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:974) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:305) ~[netty-transport-4.1.118.Final.jar:?]
at knot/net.minecraft.class_2535.method_36942(class_2535.java:351) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2535.method_10764(class_2535.java:343) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2535.method_52906(class_2535.java:325) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2535.method_10752(class_2535.java:319) ~[server-intermediary.jar:?]
at knot/net.minecraft.class_2535.exceptionCaught(class_2535.java:170) ~[server-intermediary.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.fireExceptionCaught(AbstractChannelHandlerContext.java:317) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.DefaultChannelPipeline$HeadContext.exceptionCaught(DefaultChannelPipeline.java:1324) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:346) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.AbstractChannelHandlerContext.invokeExceptionCaught(AbstractChannelHandlerContext.java:325) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.DefaultChannelPipeline.fireExceptionCaught(DefaultChannelPipeline.java:856) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.handleReadException(AbstractNioByteChannel.java:125) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:177) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:796) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:732) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:658) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562) ~[netty-transport-4.1.118.Final.jar:?]
at knot/io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998) ~[netty-common-4.1.118.Final.jar:?]
at knot/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.118.Final.jar:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]

I have this same bug on my 1.21.6 server. hopefully it gets fixed.

I also have this happening, also 1.21.6 server. Anyone have any idea why it is happening or how to fix?

Can confirm. Still happening in 1.21.8.

It’s been happening for over a year. It’s completely polluting the log files to the point of rendering them almost useless, composing over 95% of the content for a low activity server like a home one.

haykam

(Unassigned)

Community Consensus

Platform

Low

Networking

1.20.6, 24w20a, 24w21b, 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.4

Retrieved