Occasional packet encoder exception during reconfiguration
jacobsjo opened this issue ยท 5 comments
When reconfiguring using ServerPlayNetworking.reconfigure, the client sometimes gets kicked with the message:
[Render thread/WARN]: Client disconnected with reason: Internal Exception: io.netty.handler.codec.EncoderException: Pipeline has no outbound protocol configured, can't process packet class_2817[payload=RegistrationPayload[id=class_9154[id=minecraft:register], channels=[c:version, fabric:extended_block_state_particle_effect_sync, fabric:accepted_attachments_v1, c:register, fabric:custom_ingredient_sync, fabric:registry/sync/direct]]]
This appears to be a race condition. I can reliable reproduce this in my own mod worldgen-devtools using fabric api 0.120.0. It also happens with fabric api 0.119.4, but much more rarely.
Disconnection logs for both versions: (Mojmap)
disconnect-with-fapi-0.120.0-client.txt
disconnect-with-fapi-0.119.4-client.txt
I can also very rarely reproduce this with the networking api testmod (using /networktestcommand reconfigure), but I haven't been able to run that with the full fabric api enabled, so I didn't observe enhanced odds in 0.120.0.
I would guess that the enhanced odds stem from 0.120.0 adding the fabric:extended_block_state_particle_effect_sync channel. That would indicate that similar enhanced odds might happen when other mods add channels.
Wild guess: this might be related to https://report.bugs.mojang.com/servicedesk/customer/portal/2/MC-268727.
Also someone on the minecraft community support discord seems to have a similar problem on vanilla 1.21.8, and they said
it has exponentially more chances to happen when I also have a browser open too
Here is their disconnect file: disconnect-2025-07-22_04.52.47-client.txt
With debug logging enabled it seems to be much rarer for me too (or maybe its just random). But I did eventually get the error. Here is the log: https://gist.github.com/jacobsjo/d6cd53102e51ffb6ffb7f6089f7d17e4 (the interesting part is right at the bottom, you need to click the "view full file" link at the top)
Im really struggling to reproduce this, I have tried both the test mod and your project (I set both game rules and ran /reload many times). Would you be able to run with -Dfabric.log.level=debug and send that over?
IN: [play:clientbound/minecraft:start_configuration] net.minecraft.network.protocol.game.ClientboundStartConfigurationPacket -> 1 bytes
OUT: [play:serverbound/minecraft:configuration_acknowledged] net.minecraft.network.protocol.game.ServerboundConfigurationAcknowledgedPacket -> 1 bytes
IN: [play:serverbound/minecraft:configuration_acknowledged] net.minecraft.network.protocol.game.ServerboundConfigurationAcknowledgedPacket -> 1 bytes
OUT: [configuration:clientbound/minecraft:custom_payload] net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket -> 131 bytes
IN: [configuration:clientbound/minecraft:custom_payload] net.minecraft.network.protocol.common.ClientboundCustomPayloadPacket -> 131 bytes
Handling inbound packet from channel with name "minecraft:register"
OUT: [configuration:clientbound/minecraft:ping] net.minecraft.network.protocol.common.ClientboundPingPacket -> 5 bytes
Ignoring packet due to disconnection: ServerboundClientTickEndPacket[]
Ignoring packet due to disconnection: ServerboundClientTickEndPacket[]
Thats a big help, thanks. Althought doesnt make me much wiser. Ill keep looking after dealing with the snapshot.
Im still finding it hard to know whats going on here, id love to be able to reproduce it and step though with a debugger. I even wrote a quick event to constantly reconfigure and let it run for about 5 mins without any joy in reproduce it...
ServerTickEvents.END_SERVER_TICK.register(server -> {
List<ServerPlayerEntity> playerList = server.getPlayerManager().getPlayerList();
if (playerList.isEmpty()) {
return;
}
ServerPlayerEntity player = playerList.getFirst();
if (player.age < 5) {
return;
}
ServerPlayNetworking.reconfigure(player);
});Edit: also tried on a slower Windows machine.