raiguard / RecipeBook

Recipe Book for Factorio.
MIT License
20 stars 9 forks source link

Failed migration script LUA. Can be corrected by removing mod and readding after successful load. #90

Closed shockrift closed 2 years ago

shockrift commented 2 years ago

Describe the Bug

Threw a save file on a headless, on first start it crashes. I can see why the script would watch for this, but I suspect since no migrations occurred (between mod updates and save) this was not handled correctly.

"Error while running event RecipeBook::on_configuration_changed RecipeBook/scripts/migrations.lua:62: bad argument #1 of 2 to 'pairs' (table expected, got nil)".

To Reproduce

these may not be necessary (it's just faster to get the mods if you don't already have them or a script to grab them).

  1. Clear mod directory 0.1 Loaded GUI version of game and sync mods with that save to download FRESH mods to the game but do not load the game afterwards. 0.2 Close GUI and prepare a headless instance... Such as start /wait C:\factorio\bin\x64\factorio.exe --start-server C:\factorio\saves\IR2first.zip --mod-directory C:\factorio\mods\ir2 --server-settings C:\factorio\server-settings.json or the linux equivalent now...
  2. Run the headless (Here you may randomly encounter the bug if there were no migrations. If you do...)
  3. remove mod
  4. restart server
  5. readd mod
  6. restart server (no error)

Save file & Username

Username: Shockrift (likely irrelevant) IR2first.zip ^ This is the save file that was copied to the headless. IF YOU DO NOT UPLOAD A SAVE FILE AND PROVIDE YOUR USERNAME, THE BUG REPORT WILL BE IGNORED UNTIL YOU DO.

Log file

bugreport.txt

Attach factorio-current.log, found in Factorio's user data directory.

EDIT: I originally thought no migrations were being performed but apparently 3.0.2 was on the save before transfer and for whatever reason when the GUI downloaded the mods it downloaded 3.2.2 triggering the migration. image ^ This may explain the behavior and have nothing to do with the RecipeBook mod. If so my apologies.