NEZNAMY / TAB

"That" TAB plugin.
Apache License 2.0
905 stars 248 forks source link

Serverswitchevent on 1.7 Client crashes due to existing scoreboard teams #727

Closed c0dingnoobi closed 1 year ago

c0dingnoobi commented 2 years ago

Server version

1.8.8

TAB version

3.1.5

Describe the bug

Players on 1.7 experience crashes sometimes when switching servers while their scoreboard is enabled. It is not happening often, sometimes it works without any problems. To reproduce u either have to relog then multitple times until it doesnt work or restart the servers.

Expected behavior

Server switching without crashes

Steps to reproduce

  1. Join on 1.8 server using 1.7
  2. Have default config with scoreboards and globalplayerlist set
  3. Switch servers to see crash

Additional info

Client crash report: crash-2022-10-09_00.33.12-client.txt

Checklist

BomBardyGamer commented 2 years ago

Some important details have been omitted here:

  1. You are using lunar client, which has some known issues with compatibility.
  2. I assume that, as you are connecting to a 1.8 server with a 1.7 client, the server is running some form of protocol translation software, most likely ViaVersion with ViaRewind.
  3. Details about the servers being switched between and some other multi-server setup details. Are you switching between two 1.8 servers running the same software? Is TAB running on both of the backend servers and/or the proxy (which I assume is BungeeCord or a derivative, as that's the only proxy we support)?

Also, you clearly haven't read the compatibility guide well enough, as the last point at the very bottom has information about custom clients, and mentions how Lunar Client has 3 known bugs.

I don't know if anyone else wants to try and debug this, but I certainly won't try and debug this, as you're using a proprietary custom client and a version that is not supported by any of the sources that I could retrieve mappings to look at the game's source with anymore, and it hasn't been for ages.

If you can reproduce the issue without Lunar Client, with just a regular vanilla 1.7 client, then it's probably a Lunar issue, and no attempt will be made to fix it on our end. If it still occurs with a vanilla 1.7 client, me or nez will look in to it, and see what we can do.

c0dingnoobi commented 2 years ago
  1. Yes I am. The issue also has just been tested on vanilla 1.7 and behaviour still persists.
  2. Protocol translation is done with latest commit of ViaRewind
  3. Yes TAB-Bridge is on both servers which do run on 1.8

Some detail which might be important to avoid further questions. I am using XCord as for proxy but also just have been tested using latest Bungeecord. Same thing as for my spigot. I am using WindSpigot but also has been tested with vanilla Spigot 1.8.8 jar without any plugins except the Bridges. As for your last statement, i guess u meant "If you can't reproduce". As pointed in 1. it has also just been tested on vanilla 1.7 Client. Ah and my bad for not providing those details, did not think of them.

NEZNAMY commented 2 years ago

XCord has issues on 1.7 I believe, try another fork.

c0dingnoobi commented 2 years ago

As Mentioned It also has been tested using latest Bungeecord.

NEZNAMY commented 2 years ago

Latest bungeecord does not support 1.7.

c0dingnoobi commented 2 years ago

Had ViaVersion plus ViaRewind while doing that. I can test using FlameCord which has 1.7 support.

NEZNAMY commented 2 years ago

ViaVersion on bungeecord is an unfixable compatibility issue.

c0dingnoobi commented 2 years ago

Also seems to be replicateable on FlameCord (without any plugin on proxy).

c0dingnoobi commented 2 years ago

After further testing for like 2 weeks, i could reproduce that specific problem also when ever 1.7 player does not have a scoreboard defined (like f.e if he is in a world which doesnt have a scoreboard set) and stays afk for about 10 - 20 min. This also happens to 1.7 vanilla Minecraft. It has been tested using Xcord and Flamecord (ran both for like 3 days to be sure). Via is only on backends. When the client crashes it produces same Crash log with same error as i mentioned above.

My theory is that somehow even if the player doesnt have the scoreboard given by TAB, it still tries to either update or load a non existing scoreboard which causes the crashes. I personally think that the server switch event itself isnt the cause. I have tested defining a scoreboard to the server where i crashed before when switiching to. Having a scoreboard on the server leads to no crash. Whenever i remove that test scoreboard the client is again able to crash.

So to sum up Afking in world without scoreboard defined --> crash Switching to a server which has no scoreboard defined --> crash Switching to server which has scoreboard defined --> no crash

Hopefully these small details did help.

c0dingnoobi commented 2 years ago

After even testing more I can reproduce this bug with another Crash reason. Seems like when having disable_entity_metadata_rewrite in waterfall.yml disabled, the crash report is being more clear. Lunar Client Crash Log: https://pastebin.com/6czbpYKw

Vanilla 1.7 Crash Log: https://pastebin.com/TLN2MeXJ

BomBardyGamer commented 2 years ago

The fact that this is to do with scoreboard teams indicates to me that the issue is with player tags (the stuff above/below your name tag), rather than the scoreboard, which is a good indication. These errors would indicate to me that there's a desync between TAB on the server and the clients (TAB and the server think a team doesn't exist to set the nametag data, so they create one, but the client thinks the team still exists).

c0dingnoobi commented 2 years ago

Yea im currently also experiencing these crashes without scoreboards which should confirm your statement.

NEZNAMY commented 2 years ago

Try https://github.com/NEZNAMY/TAB/actions/runs/3393807158

c0dingnoobi commented 2 years ago

Works, when having disable_entity_metadata_rewrite: true in waterfall.yml set to true. Otherwhise its still crashing for same crash reason.

NEZNAMY commented 2 years ago

Sounds about right. Pipeline injection is disabled for 1.7 clients, so Login packet sent to clear data cannot be detected, so plugin assumes one was sent on server switch.

c0dingnoobi commented 2 years ago

Ah, just a reminder. It doesn't crash on serverswitchevents anymore. But it still does when being in a world which doesn't have a scoreboard set. Crash reason is also same (team already exists). It happens randomly so i guess it has something to do with any kind of refreshing.

NEZNAMY commented 2 years ago

What is the name of the team?

c0dingnoobi commented 2 years ago

01playernameA

NEZNAMY commented 2 years ago

That's from teams feature, not sidebar as you originally reported. I'll need steps to reproduce.

c0dingnoobi commented 2 years ago

Okay. I can try to do more tests to see what exactly causes it. But for now I can only say that it randomly happens with 1.7 when being in a world which doesnt have sb defined.

NEZNAMY commented 2 years ago

That's not related to scoreboard in any way.

c0dingnoobi commented 2 years ago

Okay will keep that in mind. Will just do some testing might report when i know more about it.

c0dingnoobi commented 2 years ago

Okay seems to happen whenever disable_entity_metadata_rewrite: true is true in waterfall.yml It still random and i cant figure out what does cause the crash exactly. But it only happens when that is enabled.

NEZNAMY commented 2 years ago

Do you have teams disabled in some servers?

c0dingnoobi commented 2 years ago

Not rlly no. I once removed the default two and set disable-in-servers: [] disable-in-worlds: []

NEZNAMY commented 2 years ago

Try https://github.com/NEZNAMY/TAB/actions/runs/3406131262

c0dingnoobi commented 2 years ago

kk

c0dingnoobi commented 2 years ago

Okay that might sound weird. The error message u built in never came. The clients still crashing. After further testing this seems to be irrelevant to waterfall.yml option since it happens regardless if true or false. The error message which usually should indicate which team was involved also doesnt seem to happen anymore. It just sends me the NullPointerException which i got once before (https://pastebin.com/riDqGkGY). I am still testing to see what triggers it.

NEZNAMY commented 2 years ago

Looks like I should add the check to objectives as well. However, finding the cause with steps to reproduce will help more.

c0dingnoobi commented 2 years ago

Working on it can't rlly give u any informations about reproducing yet Edit: It is still noticeable that this only occurs for player's who are in worlds which don't have any scoreboards defined. At spawn (which has a sb defined) it never happened.

c0dingnoobi commented 2 years ago

Just happened again. All players were online using 1.7 clients. The one in a world without scoreboard got kicked. The one who were in a world with a scoreboard did not get kicked.

Thats the only way to reproduce. Server has to be online for +1h (doesnt seem to happen when below)

NEZNAMY commented 2 years ago

The team name contains palyer's name. What happened to that player at the time? Did the rank change so the sorting should change? Or prefix?

c0dingnoobi commented 2 years ago

Well all player's were "afk" they mostly did nothing or only walked. Can't think of anything that would either have changed the sorting order or the player's prefix.

c0dingnoobi commented 2 years ago

Looks like I should add the check to objectives as well. However, finding the cause with steps to reproduce will help more.

I tried with localhosted network which has only TAB on bungee (flamecord) and bridge on backend (and via + viarewind). Same behaviour as before. When being in f.e nether while only world has scoreboard set, players are getting kicked after some time. If scoreboard is disabled nothing happens. If both dimensions have scoreboards set 1.7 doesnt crash while being in nether.

There are no reproducing steps. I could basically set a scoreboard for every world to avoid 1.7 this bug, which would fix it for me. But not for other users of TAB who aren't familiar why this happens.

NEZNAMY commented 2 years ago

Since the last error you sent is different, I tried to fix that one. Try new build.

c0dingnoobi commented 2 years ago

image I guess this is a success. Player was afk in a world which doesn't have a scoreboard

c0dingnoobi commented 2 years ago

This seems to also happen when doing serverswitchevents.

nhanledev commented 2 years ago

I tried to run the latest dev build and it keeps creating error.log file like this.

16.11.2022 - 16:38:02 - [TAB v3.1.5] Tried to modify non-existing team 256hibaramamoruA for player HibaraMamoru
16.11.2022 - 16:38:11 - [TAB v3.1.5] Tried to unregister non-existing team 0255hibaramamorA for player HibaraMamoru
NEZNAMY commented 2 years ago

Makes perfect sense, see the commit I pushed. I will investigate this harmless warn.

c0dingnoobi commented 2 years ago

I dont know if this would help, but it seems to happen every 20 minutes. And it also seems to happen regardless which version the player is online. Just for 1.7 it did crash. Other clients weren't noticing anything even if it said that error.