Geyser icon indicating copy to clipboard operation
Geyser copied to clipboard

Player Chat Message with ClickEvent.callback cause Downstream packet error

Open byquanton opened this issue 2 months ago • 6 comments

Describe the bug

If the server formats the player chat message with a click callback, geyser isn't showing the message on the client with the following error in the log. Downstream packet error! java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $.click_event.payload

To Reproduce

  1. Set up a Server that formats the Chat messages like in this Paper Guide: https://docs.papermc.io/paper/dev/component-api/signed-messages/#code
  2. Send a message from the Bedrock Client.

Expected behaviour

See the message in the client chat (without the click event functionality)

Screenshots / Videos

No response

Server Version and Plugins

No response

Geyser Dump

No response

Geyser Version

2.9.0-b963 (git-master-b8a3c6d)

Minecraft: Bedrock Edition Device/Version

No response

Additional Context

No response

byquanton avatar Oct 26 '25 15:10 byquanton

Could you attach the full log file please?

eclipseisoffline avatar Oct 26 '25 15:10 eclipseisoffline

Full Stacktrace with debug-mode: true

Downstream packet error! java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $.click_event.payload
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $.click_event.payload
	at com.google.gson.Gson.fromJson(Gson.java:1372)
	at com.google.gson.Gson.fromJson(Gson.java:1463)
	at com.google.gson.Gson.fromJson(Gson.java:1406)
	at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:224)
	at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:77)
	at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:308)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:83)
	at com.google.gson.internal.bind.CollectionTypeAdapterFactory$Adapter.read(CollectionTypeAdapterFactory.java:59)
	at com.google.gson.Gson.fromJson(Gson.java:1361)
	at com.google.gson.Gson.fromJson(Gson.java:1306)
	at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:183)
	at net.kyori.adventure.text.serializer.gson.ComponentSerializerImpl.read(ComponentSerializerImpl.java:77)
	at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:308)
	at com.google.gson.Gson.fromJson(Gson.java:1361)
	at com.google.gson.Gson.fromJson(Gson.java:1463)
	at com.google.gson.Gson.fromJson(Gson.java:1406)
	at net.kyori.adventure.text.serializer.gson.GsonComponentSerializerImpl.deserializeFromTree(GsonComponentSerializerImpl.java:109)
	at org.geysermc.mcprotocollib.protocol.codec.MinecraftTypes.readComponent(MinecraftTypes.java:900)
	at org.geysermc.mcprotocollib.protocol.codec.MinecraftTypes.readNullable(MinecraftTypes.java:239)
	at org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.ClientboundPlayerChatPacket.<init>(ClientboundPlayerChatPacket.java:58)
	at org.geysermc.mcprotocollib.protocol.codec.MinecraftPacketSerializer.deserialize(MinecraftPacketSerializer.java:19)
	at org.geysermc.mcprotocollib.protocol.codec.MinecraftPacketSerializer.deserialize(MinecraftPacketSerializer.java:8)
	at org.geysermc.mcprotocollib.network.codec.PacketDefinition.newInstance(PacketDefinition.java:52)
	at org.geysermc.mcprotocollib.network.packet.PacketRegistry.createClientboundPacket(PacketRegistry.java:115)
	at org.geysermc.mcprotocollib.network.netty.PacketCodec.decode(PacketCodec.java:88)
	at io.netty.handler.codec.ByteToMessageCodec$1.decode(ByteToMessageCodec.java:42)
	at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.handler.flow.FlowControlHandler.dequeue(FlowControlHandler.java:201)
	at io.netty.handler.flow.FlowControlHandler.channelRead(FlowControlHandler.java:163)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:293)
	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:354)
	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1429)
	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:918)
	at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:794)
	at io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.handle(AbstractEpollChannel.java:482)
	at io.netty.channel.epoll.EpollIoHandler$DefaultEpollIoRegistration.handle(EpollIoHandler.java:317)
	at io.netty.channel.epoll.EpollIoHandler.processReady(EpollIoHandler.java:515)
	at io.netty.channel.epoll.EpollIoHandler.run(EpollIoHandler.java:460)
	at io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:225)
	at io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:196)
	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1193)
	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:1583)
Caused by: java.lang.IllegalStateException: Expected STRING but was BEGIN_OBJECT at path $.click_event.payload
	at com.google.gson.internal.bind.JsonTreeReader.nextString(JsonTreeReader.java:203)
	at net.kyori.adventure.text.serializer.gson.StyleSerializer.read(StyleSerializer.java:197)
	at net.kyori.adventure.text.serializer.gson.StyleSerializer.read(StyleSerializer.java:73)
	at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:308)
	at com.google.gson.Gson.fromJson(Gson.java:1361)
	... 61 more

byquanton avatar Oct 26 '25 15:10 byquanton

Probably needs the adventure update in MCPL, will push that later

onebeastchris avatar Oct 26 '25 17:10 onebeastchris

Should be resolved by https://github.com/GeyserMC/Geyser/commit/59edd3a21e37c84a3b706a52174d44525d384ea0

onebeastchris avatar Oct 26 '25 18:10 onebeastchris

Tested it with 2.9.0-b966 (git-master-7375b74) and the issue is still there

byquanton avatar Oct 26 '25 21:10 byquanton

Current Adventure 5 branch already has a fix: https://github.com/PaperMC/adventure/commit/1180f89a345653f6ad3a819c3ca0a7ed8e4565c9

byquanton avatar Oct 27 '25 17:10 byquanton