NPE causing server crash
Xandaros opened this issue ยท 1 comments
Issue type:
- ๐ Bug
Short description:
Server closed with a null pointer exception
Steps to reproduce the problem:
Not entirely sure what caused it or how to reproduce it, but here is some info that might help:
It was reading NBT Data from a Click Machine , but accessed it through a Capability Proxy
Originally, there was logic to output a redstone signal when a certain NBT value goes below a certain value. I was using the normal get
to get the first item in the inventory and read its NBT. The inventory went empty and that logic failed.
I took the card out of the redstone writer and placed it back in once the inventory was filled again. I then replaced it with a simple "Inventory not empty". A short time after that, the server crashed.
After the crash, the entire system was unusable. I suspect this is to prevent repeated crashes. After replacing all the logic cable, everything started working again.
Went fine for a couple of minutes and then crashed again.
Edit:
After additional testing, this is the most minimal setup I've seen crash the server:
- Empty Strongbox from Thermal Expansion or Auto Clicker from Click Machine (from here on "strongbox")
- Capability Proxy ("proxy") adjacent to the strongbox
- Inventory Reader on the proxy
- Item Interface on the proxy
- An empty chest away from the proxy
- Item Exporter on the chest
- Item Importer on the chest
- A variable store on the network
- A display panel on the network
- Empty variable card in the item importer
- A variable card reading the list of items from the inventory reader (itemlist)
- Display panel displays this expression:
NBT.integer(NBT(get_or_default(itemlist, 0, empty_item)), "Energy")
whereempty_item
is just an item constant with nothing placed in the slot
Note that it sometimes takes quite a while to crash and sometimes crashes after just a few seconds. I'm never sure whether a given setup is safe or not... For example, right now I'm testing this setup without the item exporter (it is entirely useless), but it has been running stably for over 30 minutes.
Versions:
-
This mod: 1.1.7
-
Minecraft: 1.12.2
-
Forge: 14.23.5.2847
-
Other mods: Compact Claustrophobia 1.3.5.2
Log file:
Crash 1:
- Exception
- Full debug log (Warning: VERY big due to spammed repeated lines)
Crash 2:
- Exception (More info than above)
- Latest log