Oarcinae / FactorioScenarioMultiplayerSpawn

A custom scenario for Factorio which provides each player a unique starting spawn point in a multiplayer game.
MIT License
49 stars 30 forks source link

Shared Chest Fatal Error #119

Closed FoolishOne9k2 closed 4 years ago

FoolishOne9k2 commented 4 years ago

Received a non-recoverable error in the shared chest logic. Looks like a map cleanup is just before the error, not sure if this is related. I can't give you a ton of history on this, I haven't participated in this save. We had this happen once before, on a different save, but didn't capture save & logs since a few-minute rollback resolved it.

Save is 208h 50m of play. It is 70MB, which is above the 10MB limit of Github issues. Save can be downloaded from our public FTP: https://vault.win-serv.com/PublicStorage/DYNAMIC-NETWORKS-READ-ONLY/GameServ/Factorio.one/NAWEST-D/saves/_gsdata_/_history_/_autosave1_2020-0831-002147.zip

Relevant log section.

172.471 Error MainLoop.cpp:1207: Exception at tick 45089725: The scenario level caused a non-recoverable error. Please report this error to the scenario author.

Error while running event level::on_tick (ID 0) ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:323: table index is nil stack traceback: ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:323: in function 'SharedChestsTallyRequests' ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:463: in function 'SharedChestsOnTick' ...mmon/factorioNAWEST-D/temp/currently-playing/control.lua:295: in function <...mmon/factorioNAWEST-D/temp/currently-playing/control.lua:282> 172.471 Error ServerMultiplayerManager.cpp:90: MultiplayerManager failed: "The scenario level caused a non-recoverable error. Please report this error to the scenario author.

Error while running event level::on_tick (ID 0) ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:323: table index is nil stack traceback: ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:323: in function 'SharedChestsTallyRequests' ...rioNAWEST-D/temp/currently-playing/lib/shared_chests.lua:463: in function 'SharedChestsOnTick' ...mmon/factorioNAWEST-D/temp/currently-playing/control.lua:295: in function <...mmon/factorioNAWEST-D/temp/currently-playing/control.lua:282>" 172.471 Info ServerMultiplayerManager.cpp:772: updateTick(45089725) changing state from(InGame) to(Failed)

Oarcinae commented 4 years ago

@FoolishOne9k2 Hi! Thanks for the report. It looks like you're running an older version of my dev branch. The issue you ran into is fixed, if you wanted to fix it in your current save you can just edit the file as follows:

On line 317 of sharedchests.lua, change it from this: ` for ,chestInfo in pairs(global.shared_chests) do to for idx,chestInfo in pairs(global.shared_chests) do`

It was a typo from awhile back. The dev branch is still a bit of a work in progress so please let me know if you find any other issues too.

I will mark this as closed since it looks like it was from an old bug that was fixed, but feel free to create a new one if this does not fix it or you have other issues.

FoolishOne9k2 commented 4 years ago

@Oarcinae Thank you for the response.

Current master branch shared_chests.lua:317 is the missing the idx declaration. https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn/blob/0f8a8bf900df687e38691636aeeb884158da673a/lib/shared_chests.lua#L317

Looks like the typo was resolved in a different spot in this commit. https://github.com/Oarcinae/FactorioScenarioMultiplayerSpawn/commit/96f762c623b2bf4399e168d3636b50eaaf30fa0f