Integrated Dynamics

Integrated Dynamics

63M Downloads

Server crash - "Could not find a part container"

krzysztofKKW opened this issue ยท 22 comments

commented

Issue type:

  • ๐Ÿ› Bug

Short description:

When no players are online, after some time the server crashes with the message provided with the logs.

Steps to reproduce the problem:

The exact setup can be found in the imgur gallery.
Chunks containing it are chunk loaded with FTB Chunks.

Expected behaviour:

The part container is found, or something like that...


Versions:

  • Modpack: Enigmatica 5 0.6.3
  • This mod: 1.1.18
  • Minecraft: 1.15.2
  • Forge: 31.2.36

Log file and gallery:

https://pastebin.com/UEyG9jDA
https://imgur.com/a/ewPR55I

commented

It seems the cause is a race condition due to org.cyclops.cyclopscore.helper.TileHelpers#getChunkAtUnchecked.

What happens is when this method is run and there is a cache miss, it'll write to the chunk provider's recentPositions, recentStatuses and recentChunks. If this happens at the same time that the main (server) thread has a cache miss and also writes to the chunk provider's cache, it'll cause the cache to potentially have invalid data.

Since getTileEntity makes use of getChunk it can result in a tile entity from another chunk (with the same relative chunk position) being returned (or null if none) instead.

commented

Ok, I just applied a (potential) fix.
I won't release it just yet, as I want to be sure that this fixes all the problems that were reported in this issue.

@Ryuu-Risto @RonanRaven @MagicGonads @Bubbet @BlueAgent Could you try out the following dev-builds to see if these fix your issues, and if performance is still ok?

commented

@BlueAgent Good catch!

It looks like my change in 24b28eb78ab9958b049aa9f9faa43290ecaad6a7 wasn't a great solution.
I can't immediately think of a good alternative though.
Any suggestions are welcome.

commented

Seems okay so far :3 Will check back in later if something comes up.

As for an alternative, perhaps you could retrieve the tile / other relevant information on the main thread and then pass it off to the ingredient observer. Before the observer returns it can check that the tile is still valid. Not sure how big of a change that would be and the tile could still also update it's inventory while being observed off thread. Accessing tiles off the main thread seems kind of risky inherently since some modders may assume it is running on the server thread, but this is done for performance reasons I presume so probably something intended to be kept in otherwise I'd suggest to not do it at all. :(

Also UNSAFE_TILE_ENTITY_GETTER should probably be a ThreadLocal variable if there's more than one thread using it.

commented

I'm getting this crash when using those dev builds. Which is strange because afaict that class and field does seem to exist...

commented

@BlueAgent Thanks for checking! It looks like ID was being built using the wrong CC version.
This ID version should be better:

commented

Seems to have broken energetic sheers? Neither the server or the client i had wanted to start with the new cyclops/id.
crash-2020-11-30_12.40.26-server.txt
crash-2020-12-11_00.45.16-client.txt
For reference, the pack im using is Sigma2, but i've added integrated dynamics (and the rest of the ID mods), and aquaculture 2 to it.

commented

@Bubbet Can you check the mods folder on both the client and the server to confirm that it has:
CyclopsCore-1.15.2-1.8.6-1137.jar and IntegratedDynamics-1.15.2-1.1.19-1584.jar
That second crash should be fixed in the second dev build of ID posted above.
Edit: Ooooh I see, I think Energetic Sheep needs to be re-built as well.

commented

@BlueAgent They're definitely in there.
Interesting how the other ID mods arent complaining. Or maybe they arent yet because sheep did first.

commented

@Bubbet It's because they need to be re-built against the dev version of CyclopsCore I think, and yeah maybe ElectricSheep was the first one that ran into the error.

commented

The crafting mod is a important one to have rebuilt, i noticed the crashing a ton more once i started auto-crafting stuff.

commented

I don't think it'll work properly unless @rubensworks provides dev builds for all the mods that depend on CyclopsCore that you're using... But idk if that would be too much work. Pretty sure this issue is fixed though.

commented

Should be fixed in release 1.1.20.

commented

Thanks for reporting!

commented

Actually, my mistake, there was indeed an exporter at the specified position at the time of the crash.
I was unable to place anything there and had to set the block to air manually with /setblock.

commented

Do things work again after a server restart?

commented

Restarting has caused the block to disappear, probably due not to being able to save it correctly on shutdown.

commented

I'll need the full Forge log (when this crash occurs) before I can fix this. So if anyone can provide me with this that'd be great.

commented

Thanks for the log @RonanRaven!

Note to self, this happened right before the crash (no other soft-crashes visible):

[29Oct2020 23:35:29.398] [Server thread/INFO] [net.minecraft.world.server.ChunkManager/]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[29Oct2020 23:35:31.337] [Server thread/WARN] [net.minecraft.server.MinecraftServer/]: Can't keep up! Is the server overloaded? Running 2801ms or 56 ticks behind
commented

I'm able to reliably reproduce this error.
I was able to work around the crash by setting my docker container to run on a single core.
This started happening upon 1.1.18, something related to multi-threading would be the change of using an unsafe call (I assume unsafe being related to thread safety)
1.15.2-1.1.17...1.15.2-1.1.18

Full server log
2020-10-29-3.log

commented

Error not limited to dedicated servers
I get (what I assume is) the same error

I cannot give details from my world at the moment as I am quite busy, but I thought I'd report this anyway.

---- Minecraft Crash Report ----
// I let you down. Sorry :(

Time: 18/11/20 12:17 PM
Description: Exception in server tick loop

java.lang.IllegalStateException: Could not find a part container at DimPos(dimension=minecraft:overworld, blockPos=BlockPos{x=1771, y=81, z=1750}, worldReference=null)
	at org.cyclops.integrateddynamics.core.helper.PartHelpers.lambda$getPartContainerChecked$1(PartHelpers.java:103) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.helper.PartHelpers$$Lambda$9924/2088930099.get(Unknown Source) ~[?:?] {}
	at net.minecraftforge.common.util.LazyOptional.orElseThrow(LazyOptional.java:261) ~[?:?] {re:classloading}
	at org.cyclops.integrateddynamics.core.helper.PartHelpers.getPartContainerChecked(PartHelpers.java:103) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.PartNetworkElement.getPartContainer(PartNetworkElement.java:82) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.PartNetworkElement.getPartState(PartNetworkElement.java:127) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.PartNetworkElement.postUpdate(PartNetworkElement.java:142) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.EnergyNetwork.postUpdate(EnergyNetwork.java:51) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.Network.postUpdate(Network.java:366) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.network.Network.update(Network.java:408) ~[?:1.1.19] {re:classloading}
	at org.cyclops.integrateddynamics.core.TickHandler.onTick(TickHandler.java:65) ~[?:1.1.19] {re:classloading}
	at net.minecraftforge.eventbus.ASMEventHandler_455_TickHandler_onTick_TickEvent.invoke(.dynamic) ~[?:?] {}
	at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:80) ~[eventbus-2.2.1-service.jar:?] {}
	at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.1-service.jar:?] {}
	at net.minecraftforge.fml.hooks.BasicEventHooks.onPostServerTick(BasicEventHooks.java:119) ~[?:?] {re:classloading}
	at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:825) ~[?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
	at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A}
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) [?:?] {re:mixin,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:A}
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- System Details --
Details:
	Minecraft Version: 1.15.2
	Minecraft Version ID: 1.15.2
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_51, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 393443320 bytes (375 MB) / 2147483648 bytes (2048 MB) up to 2147483648 bytes (2048 MB)
	CPUs: 12
	JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	ModLauncher: 5.1.2+70+master.2845bb9
	ModLauncher launch target: fmlclient
	ModLauncher naming: srg
	ModLauncher services: 
		/mixin-0.8.2.jar mixin PLUGINSERVICE 
		/eventbus-2.2.1-service.jar eventbus PLUGINSERVICE 
		/forge-1.15.2-31.2.46.jar object_holder_definalize PLUGINSERVICE 
		/forge-1.15.2-31.2.46.jar runtime_enum_extender PLUGINSERVICE 
		/accesstransformers-2.1.3-shadowed.jar accesstransformer PLUGINSERVICE 
		/forge-1.15.2-31.2.46.jar capability_inject_definalize PLUGINSERVICE 
		/forge-1.15.2-31.2.46.jar runtimedistcleaner PLUGINSERVICE 
		/mixin-0.8.2.jar mixin TRANSFORMATIONSERVICE 
		/forge-1.15.2-31.2.46.jar fml TRANSFORMATIONSERVICE 
	FML: 31.2
	Forge: net.minecraftforge:31.2.46
	FML Language Providers: 
		[email protected]
		minecraft@1
	Mod List: 
		forge-1.15.2-31.2.46-client.jar Minecraft {[email protected] DONE}
		CyclopsCore-1.15.2-1.8.6.jar Cyclops Core {[email protected] DONE}
		QuarkOddities-1.15.2.jar Quark Oddities {[email protected] DONE}
		theoneprobe-1.15-2.0.7.jar The One Probe {[email protected] DONE}
		CommonCapabilities-1.15.2-2.5.4.jar CommonCapabilities {[email protected] DONE}
		astralsorcery-1.15.2-1.12.12.jar Astral Sorcery {[email protected] DONE}
		MouseTweaks-2.13-mc1.15.1.jar Mouse Tweaks {[email protected] DONE}
		jei-1.15.2-6.0.3.15.jar Just Enough Items {[email protected] DONE}
		IntegratedTerminals-1.15.2-1.0.16.jar IntegratedTerminals {[email protected] DONE, [email protected] DONE}
		curios-FORGE-1.15.2-2.0.2.6.jar Curios API {[email protected] DONE}
		Botania-r1.15-388.jar Botania {[email protected] DONE}
		Patchouli-1.15.2-1.2-35.jar Patchouli {[email protected] DONE}
		Neat+1.6-22.jar Neat {[email protected] DONE}
		create-mc1.15.2_v0.2.4e.jar Create {[email protected]_v0.2.4e+custom DONE}
		Waystones_1.15.2-6.0.2.jar Waystones {[email protected] DONE}
		IntegratedDynamics-1.15.2-1.1.19.jar IntegratedDynamics {[email protected] DONE, [email protected] DONE}
		Clumps-5.0.2.6.jar Clumps {[email protected] DONE}
		journeymap-1.15.2-5.7.0b3.jar Journeymap {[email protected] DONE}
		CTM-MC1.15.2-1.1.1.13.jar ConnectedTexturesMod {[email protected] DONE}
		CookingForBlockheads_1.15.2-8.0.3.jar Cooking for Blockheads {[email protected] DONE}
		Controlling-6.1.5.6.jar Controlling {[email protected] DONE}
		AutoRegLib-1.5-40.jar AutoRegLib {[email protected] DONE}
		StorageDrawers-1.15.2-7.0.3.jar Storage Drawers {[email protected] DONE}
		OreExcavation-1.7.151.jar Ore Excavation {oreexcavation@NONE DONE}
		FluxNetworks-1.15.2-5.0.3-4.jar Flux Networks {[email protected] DONE}
		IntegratedTunnels-1.15.2-1.6.14.jar IntegratedTunnels {[email protected] DONE, [email protected] DONE}
		libnonymous-1.15.2-1.1.1.5.jar Libnonymous {[email protected] DONE}
		integratednbt-1.15.2-1.3.0.jar Integrated NBT {integratednbt@version DONE}
		FarmingForBlockheads_1.15.2-6.1.5.jar Farming for Blockheads {[email protected] DONE}
		randompatches-1.15.2-1.22.1.1.jar RandomPatches {[email protected] DONE}
		BonsaiTrees-2.1.2.6.jar Bonsai Trees 2 {[email protected] DONE}
		ironshulkerboxes-1.15.2-4.0.1.jar Iron Shulker Boxes {[email protected] DONE}
		AppleSkin-mc1.15.2-forge-1.0.14.jar AppleSkin {[email protected] DONE}
		Chisel_DEV-MC1.15.2-0.0.1.12.jar Chisel {[email protected] DONE}
		observerlib-1.15.2-1.3.1.jar ObserverLib {[email protected] DONE}
		BackTools-1.15.2-8.0.0.jar Back Tools {[email protected] DONE}
		iChunUtil-1.15.2-8.0.3.jar iChunUtil {[email protected] DONE}
		JustEnoughResources-1.15.2-0.10.1.77.jar Just Enough Resources {[email protected] DONE}
		immersive-portals-0.24forMc1.15withForge.jar Immersive Portals {[email protected] DONE}
		forge-1.15.2-31.2.46-universal.jar Forge {[email protected] DONE}
		Quark-r2.1-245.jar Quark {[email protected] DONE}
		FastLeafDecay-v22.1.jar FastLeafDecay {[email protected] DONE}
		CosmeticArmorReworked-1.15.2-v3a.jar CosmeticArmorReworked {[email protected] DONE}
		CodeChickenLib-1.15.2-3.3.2.383-universal.jar CodeChicken Lib {[email protected] DONE}
		EnderStorage-1.15.2-2.5.0.151-universal.jar EnderStorage {[email protected] DONE}
		QuantumStorage-1.15.2-5.1.1.jar QuantumStorage {quantumstorage@NONE DONE}
		ironchest-1.15.2-10.0.3.jar Iron Chests {[email protected] DONE}
		IntegratedCrafting-1.15.2-1.0.10.jar IntegratedCrafting {[email protected] DONE}
	Patchouli open book context: n/a
	Player Count: 1 / 8; [ServerPlayerEntity['midnightgamer4'/143, l='Otfervleid', x=1759.48, y=76.00, z=1752.61]]
	Data Packs: mod:ironchest, mod:quarkoddities, mod:cookingforblockheads (incompatible), mod:farmingforblockheads (incompatible), mod:botania (incompatible), mod:patchouli (incompatible), mod:jei (incompatible), mod:jeresources (incompatible), vanilla, mod:cyclopscore (incompatible), mod:theoneprobe (incompatible), mod:commoncapabilities (incompatible), mod:astralsorcery (incompatible), mod:mousetweaks (incompatible), mod:integratedterminals (incompatible), mod:curios (incompatible), mod:neat (incompatible), mod:create, mod:waystones (incompatible), mod:integrateddynamics (incompatible), mod:clumps (incompatible), mod:journeymap (incompatible), mod:ctm, mod:controlling (incompatible), mod:autoreglib (incompatible), mod:storagedrawers (incompatible), mod:oreexcavation (incompatible), mod:fluxnetworks, mod:integratedtunnels (incompatible), mod:libnonymous (incompatible), mod:integratednbt (incompatible), mod:randompatches (incompatible), mod:bonsaitrees2, mod:ironshulkerbox (incompatible), mod:appleskin (incompatible), mod:chisel (incompatible), mod:observerlib (incompatible), mod:backtools (incompatible), mod:ichunutil (incompatible), mod:immersive_portals (incompatible), mod:forge (incompatible), mod:quark, mod:fastleafdecay, mod:cosmeticarmorreworked (incompatible), mod:codechickenlib (incompatible), mod:enderstorage (incompatible), mod:quantumstorage (incompatible), mod:integratedcrafting (incompatible)
	Type: Integrated Server (map_client.txt)
	Is Modded: Definitely; Client brand changed to 'forge'
commented

I'd also like to report I'm having the issue. The more ID pipes I have the more it seems to be crashing. I'd like to add though, that it isn't always deleting the pipe in question upon server start again, most of the time my pipes are still there after the crash. But i have had it remove the pipe and I've had to /setblock it to air like the other guy. Its also creating 'dead' tile entities, like furnaces that cant be interacted with till i break and place them, and storage drawers losing their contents.

crash-reports.zip
Here's a ton of crash logs showing the frequency of the crash, its pretty unplayable.