Page 1 of 1

bug report, which mod?

Posted: Sat Jul 08, 2023 8:30 pm
by Sneak555
I randomly got "[FI Error] Assembling machine (unit number 48373) has become invalid. Please report this error to the mod author"

1): I don't even know which mod this is coming from, how can I figure that out?
2): how do I figure out what that unit number is?

bonus: does somebody know what this bug is per-chance?

attached world save if that helps.

bonus-bonus: this is my first post here (edit: I guess my second? whatever), feel free to tell me I posted wrong somehow.

Re: bug report, which mod?

Posted: Sat Jul 08, 2023 10:20 pm
by Pi-C
Sneak555 wrote:
Sat Jul 08, 2023 8:30 pm
I randomly got "[FI Error] Assembling machine (unit number 48373) has become invalid. Please report this error to the mod author"

1): I don't even know which mod this is coming from, how can I figure that out?
I went by the assumption that "FI" might be initials of a mod name, so I looked at the list of active mods for names starting with "FI", or names consisting of two significant words, the first starting with 'F', the second with 'I'. The name "factory-inspector" looked promising, so I unpacked it and grepped recursively for "FI":

Code: Select all

$ ugrep -n FI
…
script/logger.lua:20:    game.print("[FI Error] "..string)
…
Not bad! Now if only we could find some part of the error message you've posted:

Code: Select all

$ ugrep -n "has become invalid"
script/production-tracker.lua:37:            logger.error(string.format("Assembling machine (unit number %d) has become invalid. Please report this error to the mod author", unit_number))
There you have it, looks like we've struck gold!
2): how do I figure out what that unit number is?
Every entity that is created in the game gets a unit_number; the unit_number of the first entity is 1, that of the second is 2, etc. As unit_numbers are unique, they can be used to identify a particular assembling machine, rocket silo, belt segment -- about everything that can be placed by players. Mods usually use the unit_numbers to keep track of entities they manage; as a player, you usually don't have to care about them.
bonus: does somebody know what this bug is per-chance?
The error occured in the function updateProductionAndConsumptionStatsAM, and one of the assembling-machines that were checked had become invalid -- it could have been mined by a player or bot, killed by an enemy, removed by a mod, or it could have been created by a mod that was removed from the game.