Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid components are sent to the player #2935

Open
Proximyst opened this issue Aug 7, 2020 · 23 comments
Open

Invalid components are sent to the player #2935

Proximyst opened this issue Aug 7, 2020 · 23 comments

Comments

@Proximyst
Copy link
Contributor

What behaviour is expected:

Only valid components being sent to the player.

What behaviour is observed:

The player being kicked by invalid components being sent.

Steps/models to reproduce:

So far? No idea. We (a few people in an MC-related Discord) do seem to have spotted the issue (which has been right in front of us the whole time), though.

The client does not remove any fields when parsing, which means the JsonParseException thrown and shown to the player is untouched:

https://i.gyazo.com/thumb/1200/7c45097dcba2e3950c2ddb26f6c8950d-png.jpg

More images

https://cdn.discordapp.com/attachments/289587909051416579/741310612730282114/unknown.png

https://cdn.discordapp.com/attachments/289587909051416579/739803646828740719/unknown.png

https://media.discordapp.net/attachments/723639031224729640/739435711127879680/unknown.png

https://cdn.discordapp.com/attachments/289587909051416579/739123930035650700/minecraft_hhh.PNG

https://media.discordapp.net/attachments/361812969161752577/737964227939008544/2020-07-29_17.25.43.png?width=1204&height=677

The components here are missing the action field, which is supposed to be present on both types of events. Given we only see arrays, it's safe to assume these are hover events; we've yet to see reports of what appears to be click events, from what I can find.

Plugin list:

Sometimes some, sometimes many, sometimes none. This has been reported with zero plugins, and with many plugins where two cases have had absolutely none mutual.

@Mystiflow
Copy link
Contributor

Are you able to further look into that? Because Bungee never serializes 'value' without an 'action':
https://github.com/SpigotMC/BungeeCord/blob/master/chat/src/main/java/net/md_5/bungee/chat/BaseComponentSerializer.java#L177

@Brokkonaut
Copy link
Contributor

If it can happen without any plugins - Maybe its not json created by the ChatComponentAPI, but prevoiusly serialized json sent by minecraft itself? For example contained in Books, on Signs or something else?

@HeartlessAUS
Copy link

can confirm this issue occurs with /plugins, and any plugin with hover events
my only way of reproducing the issue is to leave the server on, with no plugins for hours, sitting afk and alone on the server, but checking logs and debug, no issues seem to show other then the one displayed.
times of occurrence are also seemingly random
Spigot issue was created a few days back aswell, there is more information there about the issue: https://hub.spigotmc.org/jira/browse/SPIGOT-6056

@md-5
Copy link
Member

md-5 commented Aug 22, 2020

Still need a way to reproduce

@Corenb
Copy link

Corenb commented Aug 22, 2020

I've the same issue that I report on spigot jira : https://hub.spigotmc.org/jira/browse/SPIGOT-6012

@VanillaChan6571
Copy link

When using PlugWoman 1.2.1 + Redlib 3.2.5 can create this error 100% when doing /pl causes this component error. I had to remove this off my server.

@Corenb
Copy link

Corenb commented Aug 25, 2020

I guess this issue is Spigot side issue. Some users have exactly the same issue without using Bungeecord...

@Proximyst
Copy link
Contributor Author

It's still at fault from the BungeeCord API's chat components.

Sadly there doesn't seem to be any way to reproduce even remotely reliably; some have never encountered it, while others encounter it easily. From what I'm able to see, it's an environment issue, but I don't quite get what in that environment can cause it when some reproduce it with no plugins whatsoever.


Linked issue: https://hub.spigotmc.org/jira/browse/SPIGOT-6056

@iperrealistico
Copy link

Happening also after updating to 1.16.2

image

This one, instead, got fixed with 1.16.2

image

But i keep getting the JsonParseException

image

@iperrealistico
Copy link

A similar exception for me happens every time i do spell wrongly a material in world edit, for example //set test (test is not a registered material)

image

@klugemonkey
Copy link

This might not be related but in net.md_5.bungee.api.chat.ItemTag.java, could getAsJsonPrimative().getAsString() be failing when nbt includes new UUID Int-Array with a ';' and throwing the exception in gson? In the past the deserialization was just converting toString() and removing quotes.

@ElgarL
Copy link

ElgarL commented Oct 3, 2020

I have no crash nor issue just a warning in console (does NOT save to the log) related to this?

AdoptOpenJDK: jdk-11.0.8.10-hotspot
CraftBukkit version git-Spigot-17d78db-2577f9b (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)

>WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.google.gson.internal.bind.ReflectiveTy peAdapterFactory (file:/S:/Minecraft%20Spigot/spigot-1.16.3.jar) to field java.a wt.Color.value WARNING: Please consider reporting this to the maintainers of com.google.gson.in ternal.bind.ReflectiveTypeAdapterFactory WARNING: Use --illegal-access=warn to enable warnings of further illegal reflect ive access operations WARNING: All illegal access operations will be denied in a future release

The error shows up once after a server startup when first triggered.
The error is repeatable via the following method.

  1. Start a server with McMMO (any version).
  2. Mine or do any activity that causes a skill-up.
  3. When the chat message is displayed for the level-up the console error will display.

I can only get the warning to display this way and it will not display again until the server is rebooted.

@Janmm14
Copy link
Contributor

Janmm14 commented Oct 3, 2020

That warning is completely unrelated and can be safely ignored. Also it is intended that this only shows up once per startup.

@klugemonkey
Copy link

Minecraft 1.16.x changed how UUIDs were represented in NBT, for example it is possible to give a custom skull with a texture using a command like:
minecraft:give klugemonkey player_head{display:{Name:"{"text":"Doggo"}"},SkullOwner:{Id:[I;-1630605175,-31436972,-1719229045,-400483089],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvY2FiYjdiYTVkNTNlNzQzNzZlYjI2NWMyYmEwMzA3ZWVhZTNmZTdlMDIwMWEzOWEyODljOTY4M2UzMWI5YjdkOCJ9fX0="}]}}} 1

I'm wondering if gson is used to parse NBT of an itemstack (i.e. as used in serialization in the BungeeCord Chat API), could it fail to parse the Int-Array properly due to the semicolon and thus cause other unintended problems since the ItemTag serializer is included with all the other registeredTypeAdapters in the ComponentSerializer? Also, shouldn't this scenario be added to the testItemParse() of the ComponentsTest unit test?

@klugemonkey
Copy link

Hmm, i tried updating in the ComponentTest to try to test serialization with new UUID but was unable to produce any errors. But still looks like the ComponentTest needs some updating in this regards, but its beyond my pay-grade.

@iperrealistico
Copy link

When i updated to 1.16.3 the issue hasn't shown up for a long while. Then, suddenly, it's back.

Kicking people for malformed json text,
Messing up double blocks such as doors and beds (doors open only the bottom piece, bed gets placed only in half)

A restart fixed the issue

@iperrealistico
Copy link

Nobody wants to take care of this bug, but it has been afflicting my server since MONTHS after updating from 1.15 to 1.16.

Only a restart of the Paper/Spigot server can temporarily fix this, and yeah - this happens also on spigot, not just paper. Happens also in Tunity, that is a fork of Paper. I updated my Java version but nothing changed. I updated it today again, let's see what will happen.

This starts happening after 24+ hours of /uptime. The error does not pop up on fresh start, but things start breaking over time. Every almost single plugin that generates colored/decorated text, eventually breaks and starts spitting out this exception.

Spoke with plugin devs, they all say they aren't doing anything wrong.

@Janmm14
Copy link
Contributor

Janmm14 commented Dec 3, 2020

Nobody wants to take care of this bug, but it has been afflicting my server since MONTHS after updating from 1.15 to 1.16.

Only a restart of the Paper/Spigot server can temporarily fix this, and yeah - this happens also on spigot, not just paper. Happens also in Tunity, that is a fork of Paper. I updated my Java version but nothing changed. I updated it today again, let's see what will happen.

This starts happening after 24+ hours of /uptime. The error does not pop up on fresh start, but things start breaking over time. Every almost single plugin that generates colored/decorated text, eventually breaks and starts spitting out this exception.

Spoke with plugin devs, they all say they aren't doing anything wrong.

Nobody takes care of this bug, because nobody got clear reproduction steps.

The reproduction step: "Let a server run 24 hours and this bug will happen" is no valid reproduction step as the code does not take runtime or time into account at all.

Additionally running paper or any other fork of spigot and not spigot itself will not get you support here anyway.

@iperrealistico
Copy link

Nobody takes care of this bug, because nobody got clear reproduction steps.

The real issue with this bug is just that. We can't test how it's happening, because it takes so long to show up that we can't even think about disabling plugins one by one to see if the issue is caused by a plugin, because it would require us to stay with each plugin turned off for at least 1 day or more.

the code does not take runtime or time into account at all.

Of course it doesn't! That would be hilarious 😂 But bugs can (unwillingly). I don't really know how spigot/paper/bungeecord work, but I feel like there is a memory leak or something like that somewhere in the json parser stuff, and it slowly accumulates ""stuff"" (note the double quotation mark) until, well, it explodes and can't parse anything correctly anymore. That's a feeling tho, 100% inaccurate.

I updated to openjdk version "11.0.9.1" 2020-11-04

All I did was download openjdk-15.0.1_linux-aarch64_bin.tar.gz and then unzip it with tar xvf openjdk-15.0.1_linux-aarch64_bin.tar.gz into /root/ folder. Looks like java -version went from 11.0.9 to 11.0.9.1 without doing anything else.

Is this the correct way to update java on ubuntu? Is this the latest version?
Why everything on linux is so obscure for a normie Windows user 😆

@Janmm14
Copy link
Contributor

Janmm14 commented Dec 4, 2020

I updated to openjdk version "11.0.9.1" 2020-11-04

All I did was download openjdk-15.0.1_linux-aarch64_bin.tar.gz and then unzip it with tar xvf openjdk-15.0.1_linux-aarch64_bin.tar.gz into /root/ folder. Looks like java -version went from 11.0.9 to 11.0.9.1 without doing anything else.

Is this the correct way to update java on ubuntu? Is this the latest version?
Why everything on linux is so obscure for a normie Windows user 😆

No that is not correctly installed.
If you have a recent ubuntu installation, all you need to do is run sudo apt install openjdk-15-jre
For further help regarding linux please use other forums like spigotmc.org

@iperrealistico
Copy link

Could this be related to the issue? From time to time I get errors like this in console:

[10:05:05 INFO]: ... KingNeme ["",{"text":"\u25b6","color":"yellow"},{"text":" Website ","bold":true,"color":"gold"},{"text":"www.peacefulvanilla.club","italic":true,"color":"yellow","clickEvent":{"action":"open_url","value":"https://www.peacefulvanilla.club"}}<--[HERE]

No that is not correctly installed.

My java -version increased by .1 tho, and no, I have an older ubuntu instllation. Anyways ill use spigot forums, thanks

@iperrealistico
Copy link

Updated to OpenJDK 15, yeah - the issue is still here. Just took some days to come back. Honestly, idk how to provide more info. If someone can tell me how to help, I am willing to help.

@Janmm14
Copy link
Contributor

Janmm14 commented Jan 7, 2021

A possible culprit was identified, please check it out and report back in a couple days or a week if the issue appears again or is gone after following the workaround provided:
https://hub.spigotmc.org/jira/browse/SPIGOT-6056?focusedCommentId=38397&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-38397

Plugins found so far which might cause this bug: DiscordSRV, NuVotifier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests