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

A RuntimeException happened while ticking the server #7

Open
Mcayear opened this issue Sep 2, 2023 · 5 comments
Open

A RuntimeException happened while ticking the server #7

Mcayear opened this issue Sep 2, 2023 · 5 comments

Comments

@Mcayear
Copy link

Mcayear commented Sep 2, 2023

🐞 I found a bug

Issue Description:
I've come across an issue while monitoring my PowerNukkitX server logs. The logs contain a runtime exception error that I would like to report. Below is the relevant log entry:

08:27:40 [INFO] [-] Mcayear
08:27:40 [INFO] Mcayear[/192.168.137.254:44217] logged out, reason: Timed out
08:36:14 [ERROR] A RuntimeException occurred while ticking the server
java.util.NoSuchElementException: null
        at cn.nukkit.utils.collection.nb.Long2ObjectNonBlockingMap$SnapshotV.next(Long2ObjectNonBlockingMap.java:1147) ~[powernukkitx.jar:?]
        at cn.nukkit.utils.collection.nb.Long2ObjectNonBlockingMap$SnapshotE.next(Long2ObjectNonBlockingMap.java:1410) ~[powernukkitx.jar:?]
        at cn.nukkit.utils.collection.nb.Long2ObjectNonBlockingMap$SnapshotE.next(Long2ObjectNonBlockingMap.java:1395) ~[powernukkitx.jar:?]
        at cn.nukkit.level.Level.unloadChunks(Level.java:4616) ~[powernukkitx.jar:?]
        at cn.nukkit.level.Level.doGarbageCollection(Level.java:4540) ~[powernukkitx.jar:?]
        at cn.nukkit.Server.tickProcessor(Server.java:1168) [powernukkitx.jar:?]
        at cn.nukkit.Server.start(Server.java:1136) [powernukkitx.jar:?]
        at cn.nukkit.Server.<init>(Server.java:967) [powernukkitx.jar:?]
        at cn.nukkit.Nukkit.main(Nukkit.java:160) [powernukkitx.jar:?]

This error occurred during the server tick, leading to an unexpected runtime exception. It appears to be related to the Nukkit server's internal processing.

Steps to Reproduce:
I'm unable to provide specific steps to reproduce this issue as it occurred unexpectedly. The logs provided above contain valuable information for debugging.

Server Information:

  • PowerNukkitX Version: 1.20.10-r1 (git-1dfc7db75)
  • Terra: off

Additional Information:
If you require any additional information or logs to investigate this issue further, please let me know, and I'll provide the necessary details.

@AzaleeX
Copy link
Member

AzaleeX commented Sep 13, 2023

Before I can solve your problem, I'm going to need a little more information about the problem you're mentioning.

  1. Have you added acustom mapor a server-generated map by default ?
  2. I can see, there's a timeout from connecting to the server, which could be due to a number of things The connection to the server is too long/If the timeout is direct, it could be due to the server installation.

😓 Sorry for the late reply, but if the problem persists you can always try reinstalling the server, as I've never had this error. It could also be due to a plugin.

@Verox001
Copy link
Contributor

I got some other people encountering the error and the source is mostly modification of region files during server runtime, because chunks, loaded in NukkitX, cannot be found after their properties have changed.
Like AzaleeX pointed out, in some cases you imported a world with corrupted chunks, which also could lead to the error, but I didn't investigate that one further.

@Buddelbubi
Copy link
Member

Buddelbubi commented Sep 14, 2023

I have the same error. I try to fix it that way:
PowerNukkitX/PowerNukkitX@cf87bb3
But I did not test it yet because PNX is currently broken for WaterdogPE. Waiting for my PR.

I have to mention that the map I am using was NOT imported. It was server generated.
The server was running for a while. It seems that at some point, unloadQueue.size(); and unloadQueue.fastEntrySet().iterator(); are out of sync. But I cannot explain why this is happening..

This error is pretty critical, since it prevents players from joining when the max player count is set to 1. Players will get a "Server is full" message even though the server is empty.

@Mcayear
Copy link
Author

Mcayear commented Sep 14, 2023

Before I can solve your problem, I'm going to need a little more information about the problem you're mentioning.

  1. Have you added acustom mapor a server-generated map by default ?
  2. I can see, there's a timeout from connecting to the server, which could be due to a number of things The connection to the server is too long/If the timeout is direct, it could be due to the server installation.

😓 Sorry for the late reply, but if the problem persists you can always try reinstalling the server, as I've never had this error. It could also be due to a plugin.

I haven't added custom map; my world was generated by PNX by default.

Regarding the issue of player timeout, we can rule it out since the player exited normally at 08:27:40, while the runtime error occurred at 08:36:14.

@Mcayear
Copy link
Author

Mcayear commented Sep 14, 2023

I have the same error. I try to fix it that way: cf87bb3 But I did not test it yet because PNX is currently broken for WaterdogPE. Waiting for my PR.

I have to mention that the map I am using was NOT imported. It was server generated. The server was running for a while. It seems that at some point, unloadQueue.size(); and unloadQueue.fastEntrySet().iterator(); are out of sync. But I cannot explain why this is happening..

This error is pretty critical, since it prevents players from joining when the max player count is set to 1. Players will get a "Server is full" message even though the server is empty.

In my case, this happens about 10 minutes after all players have offline.

You've given me some food for thought, perhaps this is a block uninstallation issue?

I'm going to investigate further and try to reproduce the issue after setting the max player count to 1.

@CoolLoong CoolLoong transferred this issue from PowerNukkitX/PowerNukkitX Jan 15, 2024
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

4 participants