TelepathicGrunt / RepurposedStructures

Reusing and modifying vanilla structures for extra variety!
https://www.curseforge.com/minecraft/mc-mods/repurposed-structures
GNU Lesser General Public License v3.0
160 stars 25 forks source link

The issue stems from a server crash caused by a severe delay in processing tasks #350

Open X-Machiavelli opened 2 hours ago

X-Machiavelli commented 2 hours ago
Repurposed Structures: Failed to create valid structure with all required pieces starting from this pool file: repurposed_structures:cities/overworld/start_pool. Required pieces failed to generate the required amount are: [repurposed_structures:cities/overworld/fat_tower_top=1]  This can happen if a structure has a required piece but the structure size is set too low.  However, this is most likely caused by a structure unable to spawn properly due to hitting the world's min y or max y build thresholds or a broken RS datapack.  Try teleporting to: BlockPos{x=183, y=81, z=264} and see if the structure generated fine with the required structure piece or if it is indeed missing it.  Please report the issue to Repurposed Structures's dev with latest.log file if the structure is not cut off by world min/max y build thresholds.

The above message was displayed in the Minecraft Dedicated Server console, and I navigated to the indicated coordinates to understand the error, at which point I experienced a huge server lag and eventually the server crashed. The system provided me with a crash report and log files. I've attached them together. Luckily, the server gave me a warning beforehand. 9 out of 10 times it has crashed without warning, so I was pretty much clueless. on the other hand, my server has various optimization mods, so I can't rule out the possibility that this mod conflicted with them. (such as 'modern fix') Simultaneously, my server also has a lot of structure mods. But until now, the server was working fine (at least without errors like this). Are there any known issues that are incompatible with other mods? If so, I'd appreciate a list.

latest.log crash-2024-09-23_01.28.52-server.txt

TelepathicGrunt commented 2 hours ago

That message is not cause of the crash. It just means RS tried to spawn the structure but could not find a layout that fits. If the message printed, my code finished trying and gave up. No crash. Code after is returned back to vanilla or whatever.

Look at the thread dump section instead. Worker thread 5 shows a structure is spawning villagers like it normally does but a mod is loading up the villager trades right away. And one of the trades is a structure map which then starts trying to do a structure search and then deadlocks the server since it is already in the generating chunk thread.

TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.npc.Villager.visibleTraders_NeoForge$lockedTradesTick(Villager.java:1135) at TRANSFORMER/minecraft@1.21.1/net.minecraft.world.entity.npc.Villager.handler$zdd000$visibletraders$writeOfferingLevel(Villager.java:1092)

So you have a villager trade mod or something that is loading trades way too early. They should only load trades when player opens the villager menu. Not when villager is created during worldgen. That’s dangerous and unsafe as your crash shows