[SPIGOT-277] Sending strings which are too long. Created: 24/Dec/14  Updated: 27/Dec/14  Resolved: 26/Dec/14

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Conor McS Assignee: Thinkofname
Resolution: Won't Fix Votes: 0
Labels: Craftbukkit


 Description   

I typed /say @e in a world with quite a lot of entities loaded, but not created by any out-of-the-ordinary means - this was just flying around the spawn area testing how well the latest build works.

The next thing that happens is that my client gets kicked.
The client's error message is a bunch of nonsense.

The server console's error message:
io.netty.handler.codec.EncoderException: String too big (was 54305 bytes encoded, max 32767)

So something along the line from the @e selector to the network packet is not trimming the string to its maximum length when it should be.

Suggested fix: trim the start of the string, so it ends up sending the LAST 32767 bytes of the string, since the client's chat history won't show the start anyway. I believe this is the way that vanilla would handle the problem.



 Comments   
Comment by Conor McS [ 27/Dec/14 ]

And I know trimming the raw json wouldn't work, I mean to take out elements one by one from the start until the entire json string is 32767 characters or less.

Comment by Conor McS [ 27/Dec/14 ]

"as long as players can't cause this"
...
ahem Opped player > /say @e = exactly what caused this.

Comment by Thinkofname [ 26/Dec/14 ]

Going to leave this as won't fix as long as players can't cause this and hope Mojang reworks the system

Comment by Thinkofname [ 26/Dec/14 ]

Not a simple one to fix due to JSON chat, simply trimming that will still crash/disconnect the client

Comment by Conor McS [ 24/Dec/14 ]

Really? I've never encountered that lol. Must be something with the new using json text for everything screwed stuff up. I thought Spigot was supposed to include fixes and improvements on things like this anyway?

Comment by Black Hole [ 24/Dec/14 ]

It's a vanilla bug: https://bugs.mojang.com/browse/MC-45838

Generated at Mon Apr 07 22:29:18 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.