Fabric API

Fabric API

112M Downloads

May not call getCurrentUnsafe() from a close callback. using Tinckers Construct and Tech Reborn

jamesfoster opened this issue ยท 6 comments

commented

Hi, Our server crashed with this exception after configuring a Tech Reborn tank as shown below.

+---+
| A |
+---+---+
| B | C |
+---+---+

A: Tinkers foundry Scorched Duct filtered to a particular liquid
B: Tech Reborn Basic Tank Unit set to pull from A and push to C
C: Create Fluid Tank

I appreciate this may not be an issue with Fabric as such, but maybe you can direct me to which mod has the bug. I've checked on the TConstruct and TechReborn repos and no issues have been raised about this yet.

Is this issue potentially fixed in a later version of Fabric?

Caused by: java.lang.IllegalStateException: May not call getCurrentUnsafe() from a close callback.
  at net.fabricmc.fabric.impl.transfer.transaction.TransactionManagerImpl.getCurrentUnsafe(TransactionManagerImpl.java:53) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]
  at net.fabricmc.fabric.api.transfer.v1.transaction.Transaction.getCurrentUnsafe(Transaction.java:127) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]
  at io.github.fabricators_of_create.porting_lib.transfer.TransferUtil.getTransaction(TransferUtil.java:63) ~[porting_lib-1.2.550-beta+1.18.2-stable-5a344c98983fbde0.jar:?]
  at slimeknights.mantle.transfer.TransferUtil.getTransaction(TransferUtil.java:246) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at slimeknights.mantle.transfer.fluid.FluidStorageHandler.updateContents(FluidStorageHandler.java:42) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at slimeknights.mantle.transfer.fluid.FluidStorageHandler.<init>(FluidStorageHandler.java:32) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at slimeknights.mantle.transfer.fluid.FluidStorageHandlerItem.<init>(FluidStorageHandlerItem.java:13) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at slimeknights.mantle.transfer.TransferUtil.getFluidHandlerItem(TransferUtil.java:166) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at slimeknights.tconstruct.smeltery.block.entity.inventory.DuctItemHandler.getFluid(DuctItemHandler.java:66) ~[Hephaestus-1.18.2-3.5.2.150.jar:?]
  at slimeknights.tconstruct.smeltery.block.entity.inventory.DuctTankWrapper.drain(DuctTankWrapper.java:57) ~[Hephaestus-1.18.2-3.5.2.150.jar:?]
  at slimeknights.mantle.transfer.fluid.FluidHandlerStorage$TankStorageView.lambda$extract$0(FluidHandlerStorage.java:103) ~[mantle-1.18.2-1.9.156-de7aba986acbce6c.jar:?]
  at net.fabricmc.fabric.impl.transfer.transaction.TransactionManagerImpl$TransactionImpl.close(TransactionManagerImpl.java:138) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]
  at net.fabricmc.fabric.impl.transfer.transaction.TransactionManagerImpl$TransactionImpl.commit(TransactionManagerImpl.java:186) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]
  at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:105) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]
  at reborncore.common.blockentity.FluidConfiguration.update(FluidConfiguration.java:90) ~[reborncore-5.2.1-fc1b7746e1c33c2f.jar:?]
  at reborncore.common.blockentity.MachineBaseBlockEntity.tick(MachineBaseBlockEntity.java:189) ~[reborncore-5.2.1-fc1b7746e1c33c2f.jar:?]
  at techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity.tick(TankUnitBaseBlockEntity.java:105) ~[TechReborn-5.2.1.jar:?]
  at techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity.tick(TankUnitBaseBlockEntity.java:56) ~[TechReborn-5.2.1.jar:?]
  at reborncore.common.BaseBlockEntityProvider.lambda$getTicker$0(BaseBlockEntityProvider.java:77) ~[reborncore-5.2.1-fc1b7746e1c33c2f.jar:?]
commented

Looks like a Tinkers Construct issue, please report it there.

commented

๐Ÿ‘‹ We use the issue tracker exclusively for final bug reports and feature requests. However, this issue appears to be better suited for either a discussion thread, or a message on our discord server. Please post your request on one of these, and the conversation can continue there.

commented

Thanks. @Technici4n

What makes you think it's Tinkers?

commented

From the call stack, the transfer is initiating from Tech Reborn (everything below at net.fabricmc.fabric.api.transfer.v1.storage.StorageUtil.move(StorageUtil.java:105) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]), but the actual crash is happening in Tinkers Construct code (everything above at net.fabricmc.fabric.impl.transfer.transaction.TransactionManagerImpl$TransactionImpl.close(TransactionManagerImpl.java:138) ~[fabric-transfer-api-v1-1.6.4+f4563ac860-8b3ca84f1c5b5bf7.jar:?]).

The error states that something might be attempting to start a new transfer transaction while a previous transfer transaction is being closed. It's possible that this behavior is correct and should be supported by the Fabric Transfer API, but I would be surprised, so I assume that the blame lies on Tinkers Construct.

commented

Much appreciated ๐Ÿ‘

commented

(We can move this to a discussion thread if you prefer)

Technically, in order for the Tank to pull from the Duct, the Duct needs to pull from the Foundry's internal storage. The fact that that's happening during the close of another transaction is weird tho.

I've posted as issue in the Tinkers github.