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

Players who slept while the server shut down cannot log in again #57

Closed
sofianedjerbi opened this issue Apr 23, 2023 · 0 comments
Closed
Labels
type: bug Something doesn't work as it was intended to. version: 1.19.4 Game version 1.19.4

Comments

@sofianedjerbi
Copy link
Contributor

sofianedjerbi commented Apr 23, 2023

Expected behavior

Server stop when a player is sleeping, the player can log back.

Observed/Actual behavior

Player can't log back.

Error:

[16:27:58] [User Authenticator #0/INFO]: UUID of player skoaboi is 185cd978-a836-4a68-aa61-2debded034ab
[16:27:58] [Region Scheduler Thread #1/ERROR]: Couldn't place player in world
net.minecraft.ReportedException: Loading entity NBT
        at net.minecraft.world.entity.Entity.load(Entity.java:2502)
        at net.minecraft.world.level.storage.PlayerDataStorage.load(PlayerDataStorage.java:96)
        at net.minecraft.server.players.PlayerList.load(PlayerList.java:622)
        at net.minecraft.server.players.PlayerList.loadSpawnForNewPlayer(PlayerList.java:255)
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.handleAcceptedLogin(ServerLoginPacketListenerImpl.java:215)
        at net.minecraft.server.network.ServerLoginPacketListenerImpl.tick(ServerLoginPacketListenerImpl.java:87)
        at net.minecraft.network.Connection.tick(Connection.java:624)
        at io.papermc.paper.threadedregions.RegionizedServer.tickConnections(RegionizedServer.java:263)
        at io.papermc.paper.threadedregions.RegionizedServer.globalTick(RegionizedServer.java:213)
        at io.papermc.paper.threadedregions.RegionizedServer$GlobalTickTickHandle.tickRegion(RegionizedServer.java:149)
        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:385)
        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525)
        at java.lang.Thread.run(Thread.java:1589)
Caused by: java.lang.NullPointerException: Cannot read field "captureTreeGeneration" because the return value of "net.minecraft.world.level.World.getCurrentWorldData()" is null
        at net.minecraft.world.level.Level.getBlockState(Level.java:821)
        at net.minecraft.world.entity.LivingEntity.lambda$stopSleeping$10(LivingEntity.java:4208)
        at java.util.Optional.ifPresent(Optional.java:178)
        at net.minecraft.world.entity.LivingEntity.stopSleeping(LivingEntity.java:4207)
        at net.minecraft.world.entity.player.Player.stopSleepInBed(Player.java:1539)
        at net.minecraft.server.level.ServerPlayer.stopSleepInBed(ServerPlayer.java:1877)
        at net.minecraft.world.entity.player.Player.stopSleeping(Player.java:1549)
        at net.minecraft.server.level.ServerPlayer.readAdditionalSaveData(ServerPlayer.java:573)
        at net.minecraft.world.entity.Entity.load(Entity.java:2400)
        ... 12 more

Steps/models to reproduce

1- Sleep
2- Stop the server while sleeping
3- Start the server
4- Log back

Plugin and Datapack List

None.

Folia version

This server is running Folia version git-Folia-"41c5548" (MC: 1.19.4) (Implementing API version 1.19.4-R0.1-SNAPSHOT) (Git: https://github.com/PaperMC/Folia/commit/41c5548dee9c8c0190aea9d9a8d2b4ddc444db89)

Other

No world while sleeping ?

@sofianedjerbi sofianedjerbi added status: needs triage type: bug Something doesn't work as it was intended to. labels Apr 23, 2023
@Spottedleaf Spottedleaf changed the title Player.dat gets corrupted when the server stop when the player is sleeping Players who slept while the server shut down cannot log in again Apr 23, 2023
killerprojecte pushed a commit to killerprojecte/Folia that referenced this issue May 30, 2023
…tion

In general, worldstate read/write is unacceptable during
data deserialization and is racey even in Vanilla. But in Folia,
some accesses may throw and as such we need to fix this directly.

Fixes PaperMC#57
@kashike kashike added version: 1.19.4 Game version 1.19.4 and removed status: needs triage labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something doesn't work as it was intended to. version: 1.19.4 Game version 1.19.4
Projects
None yet
Development

No branches or pull requests

2 participants