Povstalec / StargateJourney

A repository for the Stargate Journey Minecraft Mod
39 stars 16 forks source link

Server Crash: GoauldTemple #104

Open samuli100 opened 2 months ago

samuli100 commented 2 months ago

Situation: Our server is currently running an ATM9 Server (Version: 0.2.51). Overnight, we encountered repeated crashes attributed to the GoauldTemple of the Stargate Journey mod. The sudden onset of these crashes has left us puzzled, as the root cause remains unidentified.

Troubleshooting Steps Attempted:

Attached Crash Report: crash-2024-04-10_05.27.51-server.txt

Povstalec commented 2 months ago

Alright, since the crash report path involved mixins from other mods and I've still never even used mixins, I asked around people on the Discord server if they know what might be happening and I was told this is most likely a case of slow CPU.

So, if you would, perhaps using a profiler to check what specifically is taking so long and sending the info here could help in identifying the issue, but I'm not sure if I'm capable of solving anything in this case.

Bylxly commented 2 months ago

The creator of this issue and I host the server together.

The problem is probably not due to a slow CPU. I've tried running the server locally on my PC with an i7 9700K @4.9 Ghz and the problem is still the same.

As you suggested, I ran a profiler and will attach the file for Spark Profiler

profile.zip

lukaskabc commented 2 months ago

Can you provide your world save, or if that is problematic for you, seed ?

Also are you doing something special (non vanilla) with villagers?
Like... using archeology villagers (from sg journey) in trader blocks from easy villagers or basically anything related to villagers and their trades....

Bylxly commented 2 months ago

I have just one archeology villager in my village but otherwise we arent doing anything special with them.

Here is a save of our world: MEGA

samuli100 commented 2 months ago

After thorough investigation, we've identified the root cause of the crashes: it occurs during the process of refreshing the trades of the archeologist. Specifically, when the archeologist generates a map to the Goauld Temple, it triggers the crash. The issue lies in the game's behavior of attempting to generate the map regardless of the distance to the structure. In our case, this resulted in structures being located over 30,000 blocks away, causing the server's calculation time to be consumed entirely, leading to a timeout and subsequent watchdog intervention after 180 seconds.

I've conducted extensive testing on various seeds and can confirm that this issue is reproducible under these conditions and it's noteworthy that on my CPU (Ryzen 7 7800X3D), it took approximately 4 minutes to generate the map.

A possible solution to mitigate this problem could be to set a limit on how far the structure can be from the generated map. By imposing such a limit, it is possible to prevent the game from being overwhelmed by excessively distant structures during map generation.

It's worth noting that our temporary fix of deleting the Abydos dimension was purely coincidental and not a reliable solution to the underlying problem.

lukaskabc commented 2 months ago

yes I basically just did the same thing :D

image

also afaik there should be a distance limit for the structure search

and I can give you another temporary solution, if you get to state when you are not even able to join server, kill the villager with command (from console /execute in minecraft:overworld run kill @e[type=villager] this will kill all villagers, there might be some way to specify archeologist, not sure about that)

lukaskabc commented 2 months ago

I've conducted extensive testing on various seeds and can confirm that this issue is reproducible

At this point if you have few seeds with same problem, they might be helpful for further testing

samuli100 commented 2 months ago

Regardless of the seed used, the problem persists, suggesting a recurring issue. I suspect that the extensive mod list is increasing the distance between generated structures, overwhelming the archaeologist's search process.

Povstalec commented 2 months ago

It's really weird though, since the max search distance is limited to 100 chunks, no idea what's increasing it so much it's still searching even 30 000 blocks away.

James103 commented 2 months ago

Have you tried running /locate structure #sgjourney:goauld_temple?

lukaskabc commented 2 months ago

Have you tried running /locate structure #sgjourney:goauld_temple?

There may be temples nearby, but the villagers are programmed to always look for new structures (without this, all villagers in the same place would give you the same map over and over again).
From testing it seems that the 100 chunk limit is being ignored in some way.