[SPIGOT-6056] Bungee Hover Events leads to malformed JSON components some of the time in 1.16 Created: 10/Aug/20 Updated: 17/Feb/22 |
|
| Status: | Open |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | Robert Alan Chapton | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 12 |
| Labels: | TextComponent, hover, jsonParser | ||
| Environment: |
It is unknown what environments this issue appears under |
||
| Attachments: |
|
| Version: | You are running the latest version |
| Plugin: | mcMMO and other plugins that use hover in TextComponents |
| Guidelines Read: | Yes |
| Description |
|
The following issue is a bit unusual, I cannot reproduce it, yet I am fairly certain it exists. Talking to other developers it seems no one has gotten to the bottom of this yet. This issue so far has only been seen with bungee hover components. The code in mcMMO involving JSON (and has used hover components since) has not changed from version 1.13.2 to now, and as of 1.16 certain users minecraft clients are receiving malformed JSON components causing them to disconnect from the server. Some users report that the issue happens randomly, some users say that they can reproduce it reliably. I do not know how to reproduce it currently.
Has anything significant changed relating to bungee hover implementation in 1.16? Some other plugin authors are getting this issue reported to them as well. I'm getting daily reports about it on my discord. It appears to be a known issue but without a known cause. |
| Comments |
| Comment by Leo [ 17/Feb/22 ] |
|
Hey there, I'm not sure if I have been having the exact same issue but for weeks now I've been getting the exact same error message while working on a custom plugin, no matter if the chat component was clickable/hoverable or not. I've been testing the plugin over a local server on windows (spigot version 1.8.8, viaversion version 4.1.1.), tested with 1.8.9 and 1.12.2 clients (both forge but I seriously doubt that that in itself matters). Anyhow the problem was rather stupid really, in the code I made an empty text component ecample:"TextComponent message = new TextComponent()" and then with switch cases added onto it via ".addExtra(a text component with actual content)". Whenever the message would be send to the client, the client would disconnect and say "...Don't know how to turn "blablabla" into a component". In the end the fix was to just make sure that the "message" text component(the empty one) had some text in itself(I put in " "). As I said, not sure if this is the exact issue that is mentioned in this thread, but I thought that I'd post this anyway just in case. |
| Comment by Intelli [ 14/Jan/21 ] |
|
It's possible that the StackOverflowError is from the shading. Possibly also the rarer issue of raw json text displaying in the chat. The "Internal Exception" client disconnect does seem to be a separate issue though. |
| Comment by BillyGalbreath [ 14/Jan/21 ] |
|
@janmm14 @md_5 I thought the same thing months ago (about something changing gson), but it was reproducible without any plugins installed at all back when the /plugins command had hoverable components. (and by reproducible, i mean very elusively showed itself seemingly randomly) |
| Comment by oranges13 [ 09/Jan/21 ] |
|
We are having the same issue with logblock as well. Attempting to use the plugin is kicking our admins. https://cdn.discordapp.com/attachments/507206355933855744/796899385057214474/image0.jpg |
| Comment by Leonardo Fiori [ 08/Jan/21 ] |
|
I am using both DiscordSRV and NuVotifier. Usually my kicks/crashes come from other plugins messages, such as IllegalStack. I am now checking every plugin for the folders you pointed out. They should be found at root level of the jar, right? |
| Comment by crash demons [ 07/Jan/21 ] |
|
good to hear it, I wasn't sure so I figured I would include all the suspect packages anyway. I'll edit my comment Also, sorry about the duplicate reports earlier, I wasn't expecting PRs so quickly.
As an aside, before the relocation changes on our particular server environment we were experiencing this issue a couple times a day in testing. After the relocation changes by your PRs (I pulled the same day), we haven't encountered the issue yet at all. I'm not going to say it's a success in so short a time, but it definitely looks promising. EDIT: almost a week and still no issues - for me this appears to be fixed by plugin gson relocation. |
| Comment by Janmm14 [ 07/Jan/21 ] |
|
crash demons: shading of those annotation packages is no problem.
Edit: md_5: If this is found to be the culprit, maybe the PluginClassLoaders should be edited to ask the parent class loader first and/or spill out warnings if plugins are found to shade in classes present in spigot jar. |
| Comment by crash demons [ 06/Jan/21 ] |
|
I went through every plugin jar on our server with JD and checked for shading and obvious unpacked jars. Things I noticed that could conflict: Several of these are very popular plugins so this is concerning...
EDIT: looks like Janmm14 was very proactive in getting these patched I've pulled some of the fixed versions/code for the gson-shaded plugins and I'm going to test it out and see if it resolves the issue for us. |
| Comment by md_5 [ 06/Jan/21 ] |
|
Janmm14 I think you may be right |
| Comment by Markus Steiner [ 06/Jan/21 ] |
|
For some reason I didn't see this open issue before. I have commented a few related messages including a stack trace here: https://hub.spigotmc.org/jira/browse/SPIGOT-6012?focusedCommentId=38373&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-38373 |
| Comment by Janmm14 [ 06/Jan/21 ] |
|
My idea is that this is caused by gson being shaded without relocation into some plugins. A sample size of 2 people (unfotunaly quite low) with this problem both had at least one plugin with this issue. This issue in itself is a huge riddle, I think investigating this idea further is worh the time.
Due to the low sample size so far I am asking you to check your plugin jars, so we can see if it is a correlation or just a coincidence: Someone who experiences this issue should open all their plugin jars as zip and look if there is the folder structure com/google/gson, net/md_5/bungee/api or net/md_5/bungee/chat present. If yes: Try to delete the innermost folder ("gson", "api", "chat") of that specifc path inside the jar (including its content) and report back after a couple days or a week. if this problem appeared again or not. If no: Then my theory is rip or there are multiple root causes of this problem.
Edit: There is no need to report this to DiscordSRV or NuVotifier. Those plugins are already informed by me.
|
| Comment by crash demons [ 05/Jan/21 ] |
|
I've also been having this issue suddenly without changing anything except server build (latest spigot or paper on java 8 or 11). Sometimes the issue will trigger and sometimes it won't. Specific examples I've seen are from PremiumVanish's "click to dismiss" message and a custom plugin that adds hover items to chat. I don't notice that either are doing anything particularly strange.
No warnings or errors are shown on the server-side and it has proven difficult to reproduce reliably or capture, but I will say that it doesn't start immediately after a restart but later on something causes it to start happening during the session/run - at least in my case. This can happen in a couple hours of runtime in our case and not requiring 24 hours like mentioned above. The vanilla item hover in death messages doesn't seem to be affected by the issue, as you would expect.
EDIT: I made a copy of our live server with the same configurations etc (only the world should be different) but I was unable to reproduce the issue on my own with a single person. I may need to find a way to test with multiple connections or extended runtime... |
| Comment by Leonardo Fiori [ 16/Dec/20 ] |
|
Updated to OpenJDK 15 - 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. |
| Comment by Leonardo Fiori [ 03/Dec/20 ] |
|
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 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 happens 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. |
| Comment by HexedHero [ 29/Oct/20 ] |
|
>I get this when using Holographic Displays commands, but the exact same message. Have you guys gotten a fix yet? I have previously had it when using ShowItem plugin commands, as well as DiscordSRV /discord link command. Obviously not related just to those plugins - worked with the dev of DiscordSRV and he said it was a BungeeCord Chat API issue, although I don't actually have BungeeChat. Just because you don't have or use Bungeecord doesn't mean your server isn't using its API. Its very common for Spigot plugins to use the Bungeecord API since it normally has more features such as this. |
| Comment by Lucas Covey [ 29/Oct/20 ] |
|
I get this when using Holographic Displays commands, but the exact same message. Have you guys gotten a fix yet? I have previously had it when using ShowItem plugin commands, as well as DiscordSRV /discord link command. Obviously not related just to those plugins - worked with the dev of DiscordSRV and he said it was a BungeeCord Chat API issue, although I don't actually have BungeeChat. |
| Comment by Intelli [ 25/Sep/20 ] |
|
Found a new error message related to the same issue:
This error is a bit different, as it occurred while manually processing a hover event with player.spigot().sendMessage(ComponentSerializer.parse(rawMessage)); As in other reports, this error persisted until the server was rebooted. Hopefully it gives some more insight into what's going wrong. |
| Comment by Pierce Thompson [ 18/Sep/20 ] |
|
Yeah happens with Paper 1.16.3 build 197 & Waterfall build 377 on PopOS 20.04 with Java 11.0.8. For me, 3 restarts didn't fix it even temporarily so like Floris said restarts fixing it is a little dodgy. Hope that helps a little bit also |
| Comment by Floris Fiedeldij Dop [ 18/Sep/20 ] |
|
We've moved to Paper, which didn't fix it either. Sometimes a restart fixes it, but then the next morning the issues are sometimes back. We have servers running on macOS local for testing and what not, it happens there on java11, and on java11 with ubuntu 18.04 lts (provider 1 with 3 servers) and ubuntu 20 (provider2 with 1 server) I hope that information helps somehow. |
| Comment by Robert Alan Chapton [ 16/Aug/20 ] |
|
I hope this gets fixed soon |
| Comment by Floris Fiedeldij Dop [ 16/Aug/20 ] |
|
We have Spigot --rev 1.16.1 today, and installed mcMMO, ShopChest, and a few other plugins. And interacting with them, instantly disconnects players. >ver I wish i had more info Our network servers ticket system now has 27 assigned tickets to staff with this issue from the last day. Last week this didn't seem to be an issue in Spigot 1.16.1 (just mentioning) Not sure what to report, players right click on shopchest chest, always worked, now they instantly disconnect, the screen on their side reads: forcefully disconnected, and ingame it just shows them *Disconnected. mcMMO spits out as per screenshot, on almost every command like /acrobatics or /mining. Sorry if i dont have more information. Oh we're on java11, ubuntu 18, ubuntu 20, macOS catalina, and make our own jars with buildtools. |
| Comment by md_5 [ 13/Aug/20 ] |
|
You might have better luck on the bungeecord issue tracker, but really we need a way to reproduce. |
| Comment by Intelli [ 12/Aug/20 ] |
|
To add on:
|
| Comment by Intelli [ 12/Aug/20 ] |
|
The strings? We're using it for timestamps, so for the TextComponent is like this: String textComponentText = ChatColor.GRAY + "1.50/d ago"; And the hover text is like this: String hoverEventText = ChatColor.GRAY + "2020-06-30 01:45:01 EDT"; Here's a screenshot of one of the disconnects a user received:
|
| Comment by md_5 [ 12/Aug/20 ] |
|
We need the exact message to reproduce, its not gonna be random |
| Comment by Intelli [ 12/Aug/20 ] |
|
I can confirm this is occurring for some CoreProtect users also, although it seems to be a very sporadic issue. This is the code in CoreProtect v19.1: TextComponent component = new TextComponent(textComponentText); component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.fromLegacyText(hoverEventText))); message.addExtra(component);
More rarely even, some users are getting a StackOverflowError that keeps repeating. I've included a bit of that below:
|
| Comment by Robert Alan Chapton [ 11/Aug/20 ] |
|
@md_5 I have two users telling me they are on the latest version of 1.16.1 and still experience the issue, one of them told me this a few minutes ago, the other one told me before I posted this issue (which means I haven't heard if he still has the issue with the latest 1.16.1 commit) I also have some new information to share, according to other devs who experience this issue, apparently it is not limited to hover events and the error can happen with TextComponents that don't make use of hover events. I don't have any information as of yet as to whether or not this issue happens in 1.16.2 |
| Comment by md_5 [ 11/Aug/20 ] |
|
Are you sure they are running the latest version? There were lots of fixes to hover event support. |