mark2devel / mark2

Minecraft Multi Server Wrapper Written in Python with Twisted; Pull Requests HIGHLY Encouraged, Collaborators Needed Discord: https://discord.gg/zymJygHNpv
Other
205 stars 44 forks source link

Mark2 does not restart on unknown crash #155

Closed TheCoder3156 closed 2 years ago

TheCoder3156 commented 2 years ago

The setting is enabled and it doesn't work. The crash is from a server tick taking to long.

Column01 commented 2 years ago

Can you provide the log for the server as well as the logs from the /tmp/mark2 folder? If the server were to hard crash, it can knock it off of the server wrapper and it won't restart

Column01 commented 2 years ago

The logs in the /tmp/mark2 folder will be split up, if possible, combine them into one file for the time where the server crashed and didn't come back (check the timestamps of the files and get ones in the server's startup time)

Column01 commented 2 years ago

@TheCoder3156 any update on the logs I requested?

TheCoder3156 commented 2 years ago

Yeah sorry I'll get them to you in a minute, I've been busy

TheCoder3156 commented 2 years ago

I've rebooted since then so I have to replicate the crash.

TheCoder3156 commented 2 years ago

Here you go survival.log

Column01 commented 2 years ago

It looks like you were pregenerating chunks when it happened, and you had a crash mark2 wasn't able to recover from because the server was force killed by something.

[FATAL] A single server tick took 60.42 seconds (should be max 0.05)
[FATAL] Considering it to be crashed, server will forcibly shutdown.
TheCoder3156 commented 2 years ago

I know but [ERROR] This crash report has been saved to: /opt/minecraft/survival/./crash-reports/crash-2021-11-11_13.13.53-server.txt so it should restart because it sees an error

TheCoder3156 commented 2 years ago

The regex seems to catch it but doesn't restart

Column01 commented 2 years ago

Mark2 caught the error, and triggered a restart, but whatever "crashed" the server force killed it with a SIGINT and when that happens, mark2 closes to prevent data loss or unintended reboots of the server.

2021-11-11 13:13:54-0500 [mark2] 2021-11-11 13:13:54 # server crashed for unknown reason, restarting...
2021-11-11 13:13:54-0500 [mark2] 2021-11-11 13:13:54 # stopping survival (caused by unknown reason)
2021-11-11 13:13:54-0500 [mark2] 2021-11-11 13:13:53 | [ERROR] This crash report has been saved to: /opt/minecraft/survival/./crash-reports/crash-2021-11-11_13.13.53-server.txt
2021-11-11 13:14:04-0500 [mark2] 2021-11-11 13:14:04 # fatal error: A process has ended with a probable error condition: process ended with exit code 1.
2021-11-11 13:14:04-0500 [-] Received SIGINT, shutting down.
2021-11-11 13:14:04-0500 [mark2] 2021-11-11 13:14:04 # mark2 stopped.
Column01 commented 2 years ago

https://github.com/mark2devel/mark2/blob/c869a91a24f603ca7c81a5e05c31665c1fd8c13b/mk2/manager.py#L194-L197

TheCoder3156 commented 2 years ago

Hmm I'll try something on my end

Column01 commented 2 years ago

It's not something mark2 would catch and reboot from because it was a fatal crash, see the code I sent above. This happens when a FATAL log level message is found in the console output, which was caused by whatever killed the server due to it being frozen for a while. I assume it's probably fabric or a mod doing it

Column01 commented 2 years ago

Since this is not an issue with mark2, I'm going to close this. If you need further help, I see you joined our discord, that's the perfect spot for minor server support 😄

TheCoder3156 commented 2 years ago

I tested removing all mods but the pregenerator and I still doesn't work. Later when I have the time I will test without it. This might need to be reopened because its a crash from tick speed not a mod.

Column01 commented 2 years ago

mark2 does not affect the tick speed of the server, it simply relays the console output to a detachable client. The actual performance of the server is still dictated by the server and what's running on it, mark2 is a separate entity in that regard

TheCoder3156 commented 2 years ago

I'm aware but when it crashes from tick speed it doesn't restart

Column01 commented 2 years ago

Again, that's not a mark2 bug, that's because whatever caused the tickspeed crash (I.E. whatever killed the server) did so in a manner that printed a FATAL error to the console, in cases like this, mark2 will not reboot the server as 90% of the time it could cause data loss or other serious issues to occur.

TL;DR this is intentional behaviour

TheCoder3156 commented 2 years ago

OK thanks for your help

Column01 commented 2 years ago

Anytime :D if you need help tracking it down, use discord as its not a mark2 issue. I'm more than happy to help diagnose the problem though