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'
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 26

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.

16 more comments

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.

Can’t it just be some compact log for those kind of exception?

Log itself doesn’t show any remote ip address, but when you see active TCP connections, there are some connection. Blocking ip related with that connection with firewall can be temporary fix.

I think server should automatically add those ip to blacklist when it got those exception. Looks like there’s bot trying old exploit that existed before 1.20.6

I’m now logging all established TCP connection to port 25565. There are some connection that MC Server doesn’t display. Some of them make server throw exception like an hour after that.

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, 1.21.10, 1.21.11 Pre-Release 3

Retrieved