Applied Energistics 2

Applied Energistics 2

160M Downloads

1.19.2 - Deadlock on Server Startup

psychon-night opened this issue ยท 11 comments

commented

Describe the bug

I started up my server and played on it for a few hours after installing AE2. I put a bunch of full disk racks (100+) in the same four chunks and used for of those developer "chunk loaders", figuring they'd keep those chunks loaded so I can access my stuff anywhere.

I then used a quantum link to connect my base (5k blocks away) to the storage. This works as expected

I restarted my server a few hours later, but it gets stuck on "Preparing start region for dimension minecraft:overworld" and deadlocks. Leaving it for 15+ hours had no effect. Looking at the log, it seems to get stuck at 88% and dies there

The server is completely unresponsive, not accepting commands in the terminal. Tools to check the server's status say they can't connect, and the Minecraft client gets stuck saying the server is old and can't connect (it gets stuck on Connecting to server)

How to reproduce the bug

Place a network in a permanently loaded chunk (probably using the mod's chunkloader block), link it up to a remote network, and put a bunch of items in it

Shut down the server and then re-initialise it

Observe deadlock

Expected behavior

Server should be able to load all chunks and start correctly

Server should not deadlock

Additional details

I'm using appliedenergistics2-fabric-12.9.9.jar on both client and server

Which minecraft version are you using?

1.19

On which mod loaders does it happen?

Fabric

Crash log

https://pastebin.com/CTkh8Twk

commented

Please post a thread dump.

commented

If I recall correctly, doesn't the server need to crash to make one of those?

How would I go about getting one on a completely locked-up server?

commented

The entire point is to debug locks ;)

https://www.baeldung.com/java-thread-dump

commented

Ah, thank you.
Pastebin is down right now, so... I apologise, but here's a text file. I think I got the right process? There were a LOT of java processes for the server

threadDump.txt

commented

I don't see anything from AE2. I'd recommend removing other mods until the problem is identified. (If you have any sort of dimensional threading mod that should be removed)

commented

I removed every single mod except for AE2 and the fabric API (0.76.1). The server still locks up while trying to prepare the start region. I tried this on a brand-new world

commented

Can you post a thread dump and the log with all the other mods removed?

commented

latest.log
dump.txt

Here you go!

commented

Confirmed to be an AE2 bug:

"Server thread" #38 prio=8 os_prio=0 cpu=8956.83ms elapsed=131.06s allocated=1433M defined_classes=1197 tid=0x00007f67d5edd250 nid=0xdb587 runnable  [0x00007f67b4a54000]
   java.lang.Thread.State: TIMED_WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x000000070b400000> (a java.lang.String)
	at java.util.concurrent.locks.LockSupport.parkNanos([email protected]/LockSupport.java:252)
	at net.minecraft.util.thread.ThreadExecutor.waitForTasks(ThreadExecutor.java:152)
	at net.minecraft.util.thread.ThreadExecutor.runTasks(ThreadExecutor.java:142)
	at net.minecraft.server.world.ServerChunkManager.getChunk(ServerChunkManager.java:139)
	at net.minecraft.world.World.getChunk(World.java:197)
	at net.minecraft.world.WorldView.getChunk(WorldView.java:156)
	at net.minecraft.world.World.getChunk(World.java:191)
	at net.minecraft.server.world.ServerWorld.setChunkForced(ServerWorld.java:1253)
	at appeng.debug.ChunkLoaderBlockEntity.cancelRemoval(ChunkLoaderBlockEntity.java:45)
	at net.minecraft.world.chunk.WorldChunk.setBlockEntity(WorldChunk.java:367)
	at net.minecraft.world.ChunkSerializer.method_39797(ChunkSerializer.java:430)
	at net.minecraft.class_2852$$Lambda$5197/0x00007f6758aef770.run(Unknown Source)
	at net.minecraft.world.chunk.WorldChunk.loadEntities(WorldChunk.java:434)
commented

Debug chunkloader is not a supported block, sorry.

commented

Note: we will remove the debug chunk loader in the next 1.20.4 update due to this issue (as well as the Spatial Anchor being the replacement - unfortunately it doesn't work on Fabric 1.19.2 as far as I know). I recommend removing the debug chunk loader from your world using a save editor program, and in general, I recommend not using developer tools as they can lead to this sort of issue.