Page 1 of 1

[2.1.19] Inserters stuck not working. Deadlocked?

Posted: Sun Sep 20, 2026 1:59 am
by Chrisdasdasd
Hi Team,

Let me start by apologising for mistakes I made with this post. It is my first bug report.

TL;DR
I believe what is happening is that inserters are waiting for space in destination container but space is already there.


I am unable to reproduce this. Game was running fine for hours. Suddenly I got warning about no ammo in turret.
It was one of my space platforms. When I investigated I found out there was no iron for ammo production. All because inserter responsible for iron ore delivery went on strike. If I rotate one of bugged inserters all of them work again. There are 4 spaces left in container but if i clear additional space, bugged inserters start working again. If I rotate belt where items sit ready for pickup, bugged inserters start working again. I loaded previous autosave from 10 minutes before bug but it did not reoccur.

Here are reference pictures,

Destination container - space platform hub:
4 spaces available in destination container
4 spaces available in destination container
09-20-2026, 03-34-06.png (862.39 KiB) Viewed 500 times
Source container - crusher:
Full source container
Full source container
09-20-2026, 03-38-00.png (2.49 MiB) Viewed 500 times
Bugged inserter, holding nothing:
One of bugged inserters
One of bugged inserters
09-20-2026, 03-40-09.png (959.09 KiB) Viewed 500 times
Other inserters marked:
All related inserters
All related inserters
09-20-2026, 03-43-31.png (3.5 MiB) Viewed 500 times
I. Waiting for source items when source container is full.
II. Waiting for source items when source container contains items to pick.
III. Claims target is full while holding carbonic asteroid.
IV. Claims target is full while holding carbonic asteroid.
V. Waiting for source items when source belt contains items to pick.
VI. Looks fine. No items to pick in source container.

I attached save file as well. Affected platform name is "Pahits BMW"
If there is anything else you need, please let me know

Kind regards
Chris

Re: [2.1.19] Inserters stuck not working. Deadlocked?

Posted: Sun Sep 20, 2026 7:19 am
by boskid
Hm... this situation is really tricky given that i was able to reproduce it. I can fix the immediate issue that you see (inserter not working when there are empty slots) but that does not mean what you get will be what you want.

Tricky part about space platform hubs is that their inventory is not sorted unless being looked at. Immediate issue that i was able to find in the code is that when inventory is sorted, input inserters are not notified about inventory sorting while they should because sorting may create empty slots to appear.

My reproduction for this issue is following:
1/ create new space platform hub and set hub's inventory bar to 2 stacks
2/ close space platform hub and do not open it as it will sort inventory breaking reproduction
3/ insert 1 oxide asteroid chunk (using inserter or manually) - (state of inventory: [1x oxide] [empty stack])
4/ insert 50 ice (using inserter or manually) - (state of inventory: [1x oxide] [50x ice])
5/ remove 1 oxide asteroid chunk (using inserter) - (state of inventory: [empty stack] [50x ice])
6/ insert 1 ice (using inserter or manually) - (state of inventory: [1x ice] [50x ice])
7/ remove 1 ice (using inserter) - (state of inventory: [1x ice] [49x ice])
8/ have an inserter that tries to insert iron-ore: this inserter is unable to insert and goes to sleep
9/ open space platform hub: there is 1 empty stack visible
10/ inserter that tries to insert iron-ore is still stuck.

Issue here is that after step 7, there are 2 stacks with ice: [1x ice] [49x ice] so at step 8 inserter is genuinely unable to insert iron-ore because all stacks are occupied, however opening hub in step 9 causes inventory to be sorted into [50x ice] [empty stack] without notifying the inserter that sorting happened.

Directly applying fix to the found issue (inserter not notified when inventory is sorted) would mean that when you open the hub in step 9, inserter will appear to fix itself, but it would not prevent it from being stuck at step 8. That means fix for this would not cause your save to become immune to this type of deadlock, just that when you open a hub, it would unstuck itself because of inventory sorting creating an empty stack.

Re: [2.1.19] Inserters stuck not working. Deadlocked?

Posted: Sun Sep 20, 2026 7:43 am
by boskid
Main issue (inserters not notified when hub is sorted) is fixed for 2.1.20. Your save file however remains vulnerable to deadlocks when items get fragmented across multiple stacks inside of a hub inventory.

In order for this behavior to go away entirely, change to inserters logic would be required: currently inserters always take from last stack with matching item, however for this situation to not happen, an inserter would have to notice that last stack is full and there are earlier stacks with the same item that are not full and take from an earlier stack. This behavior change would come with a performance penalty of looking into more stacks of the inventory than needed. This would make inventory at step 7 not become fragmented.

Re: [2.1.19] Inserters stuck not working. Deadlocked?

Posted: Sun Sep 20, 2026 12:55 pm
by Chrisdasdasd
Thank you for quick fix.
Please note: this bug mean that at extreme, we could temporarily "lose" half of hub's available space.
09-20-2026, 14-45-41.png
09-20-2026, 14-45-41.png (2.42 MiB) Viewed 279 times
As counter argument, I played Space Age for about 600 hours and never noticed this before so I guess it is fine.