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

Player data desync on server change #292

Closed
nhanledev opened this issue Apr 22, 2024 · 5 comments
Closed

Player data desync on server change #292

nhanledev opened this issue Apr 22, 2024 · 5 comments
Labels
resolution: get support on discord Please let us help you with your issue on Discord for now!

Comments

@nhanledev
Copy link
Contributor

nhanledev commented Apr 22, 2024

Player data sometimes doesn’t sync between the server until the player rejoins the network (quits the server and rejoins).

I’m not sure if this is a bug or if the server is too weak. However, this issue occurs even when there are only 2-3 players on the server, resulting in the following error. This error has been observed since the attribute sync update.

[10:05:08] [Server thread/INFO]: TheBestWarden issued server command: /back
[10:05:08] [Server thread/INFO]: TheBestWarden lost connection: Disconnected
[10:05:18] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH  - git-Paper-455 (MC: 1.20.4) ---
[10:05:18] [Paper Watchdog Thread/ERROR]: The server has not responded for 10 seconds! Creating thread dump
[10:05:18] [Paper Watchdog Thread/ERROR]: ------------------------------
[10:05:18] [Paper Watchdog Thread/ERROR]: Server thread dump (Look for plugins here before reporting to Paper!):
[10:05:18] [Paper Watchdog Thread/ERROR]: ------------------------------
[10:05:18] [Paper Watchdog Thread/ERROR]: Current Thread: Server thread
[10:05:18] [Paper Watchdog Thread/ERROR]: 	PID: 29 | Suspended: false | Native: true | State: RUNNABLE
[10:05:18] [Paper Watchdog Thread/ERROR]: 	Stack:
[10:05:20] [Server thread/WARN]: Can't keep up! Is the server overloaded? Running 11311ms or 226 ticks behind
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.FileDispatcherImpl.write0(Native Method)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.FileDispatcherImpl.write(FileDispatcherImpl.java:62)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:132)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.IOUtil.write(IOUtil.java:97)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.IOUtil.write(IOUtil.java:67)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/sun.nio.ch.FileChannelImpl.write(FileChannelImpl.java:288)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.nio.channels.Channels.writeFullyImpl(Channels.java:74)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.nio.channels.Channels.writeFully(Channels.java:96)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.nio.channels.Channels$1.write(Channels.java:171)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.io.BufferedOutputStream.write(BufferedOutputStream.java:127)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.util.zip.GZIPOutputStream.finish(GZIPOutputStream.java:168)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.util.zip.DeflaterOutputStream.close(DeflaterOutputStream.java:244)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.io.FilterOutputStream.close(FilterOutputStream.java:188)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.nbt.NbtIo.writeCompressed(NbtIo.java:194)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.nbt.NbtIo.writeCompressed(NbtIo.java:146)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.world.level.storage.PlayerDataStorage.save(PlayerDataStorage.java:44)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.players.PlayerList.save(PlayerList.java:581)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.players.PlayerList.remove(PlayerList.java:637)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.players.PlayerList.remove(PlayerList.java:598)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.removePlayerFromWorld(ServerGamePacketListenerImpl.java:2093)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2073)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerGamePacketListenerImpl.onDisconnect(ServerGamePacketListenerImpl.java:2060)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.network.Connection.handleDisconnection(Connection.java:837)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.network.ServerConnectionListener.tick(ServerConnectionListener.java:254)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1746)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1525)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1226)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		net.minecraft.server.MinecraftServer$$Lambda$6412/0x00007fd080c5fd58.run(Unknown Source)
[10:05:20] [Paper Watchdog Thread/ERROR]: 		java.base@17.0.10/java.lang.Thread.run(Thread.java:840)
[10:05:20] [Paper Watchdog Thread/ERROR]: ------------------------------
[10:05:20] [Paper Watchdog Thread/ERROR]: --- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---
[10:05:20] [Paper Watchdog Thread/ERROR]: ------------------------------

Edit: My english is too funny, grammar correction.

@nhanledev
Copy link
Contributor Author

This issue happens since the update of attribute synchronization. I have been running earlier version for a long time with no sync issue than the "health" one.

@WiIIiam278
Copy link
Owner

WiIIiam278 commented Apr 22, 2024

It looks like it failed to finish processing the disconnect packet on your server due to thread timeout. Try disabling sync modes?

Honestly this is kind of unusual; I'm not doing anything massively expensive aside from reading player attribute data, is your server that low spec?

@nhanledev
Copy link
Contributor Author

I find it unusual too since the TPS remain consistently at 20. This is the second time that my player report a desync problem since the update to 3.5. I plan to test a different infrastructure to determine if the issue persists. My current cpu is ryzen 5800x and it's a shared plan so I'm not sure if it's the spike, because if player don't disconnect from the network, the problem is still there each disconnection event.

@WiIIiam278
Copy link
Owner

Your hardware seems reasonable enough

Looking at the trace in more detail - it seems like it's crashing on an I/O write of that player's data to their NBT data file (like, the actual .dat file in the playerdata directory on your server.

HuskSync doesn't prevent Minecraft from persisting user data to disk, as is by default, for redundancy purposes. Have you done something to remove permissions from writes to the playerdata directory in your world folder / are you doing stuff with that data to, say, delete or move it?

@WiIIiam278 WiIIiam278 added the status: needs testing This needs video proof and testing label Apr 23, 2024
@WiIIiam278
Copy link
Owner

Closing this as the issue reported seems specific to the user's case - if further help is needed, get in touch on Discord.

@WiIIiam278 WiIIiam278 closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2024
@WiIIiam278 WiIIiam278 added resolution: get support on discord Please let us help you with your issue on Discord for now! and removed status: needs testing This needs video proof and testing labels May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: get support on discord Please let us help you with your issue on Discord for now!
Projects
None yet
Development

No branches or pull requests

2 participants