This mod helps you to keep track of your mining sites, with useful data such as the percent mined, and estimated time to depletion.
Providing the player with new tools or adjusting the game interface, without fundamentally changing gameplay.
New Ores and resources as well as machines.
Map cannot be saved: The mod YARM - Resource Monitor (0.11.0) caused an error that cannot be fixed.
Please inform the author of the mod about this error.
Error while running event YARM::on_save()
Cannot serialise lua functions
The error always occurs during autosave, normal saving and loading works but no autosave is created
for me it's the other way around - autosaves seem to be functioning, but I can't manually save
Is this somewhat tick depended?
When I can't manually save it, I just wait a second more and then it works.
Definitely tick dependent - it hits an autosave a couple times an hour for me, and I got it once during a manual save but letting the game run (not just sitting in the menu with the game paused) for a second and then trying to save again works.
hmm deinstall > reinstall no error
same for me, removed and reinstalled the YARM mod, and the next autosave (and manual save) was fine.
We're having some real trouble nailing this down. Are y'all experiencing this on a fresh savegame?
for me it's not a fresh savegame. made the save on space age's launch day, so a day before this mod updated.
would you like a save file to help you debug? note that I am using several mods, though. including the dlc. (here's my list: https://puu.sh/KhhDd/faf893e1d4.png)
Yes, uploading a savegame and instructions on how to recreate the issue is most optimal. :)
I can't really come up with instructions on how to recreate the issue since, after reloading from the autosave, I managed to save properly, and as others mentioned, sometimes it saves just fine, and sometimes it throws errors, so uh. guess all I can say is, run around a bit and save periodically until it throws a fit and then check the logs? there doesn't seem to be any rhyme or reason to it to me.
here's my most recent save in the meanwhile though: https://www.dropbox.com/scl/fi/w9pichphnima1pfwh69de/space-age-2.zip?rlkey=nlipwz1amruztnwdzguqz9kjx&st=vmwazdbb&dl=0
(please pardon the silliness that is my crafting queue lol)
Understood, and thanks for the effort. Also now that you mention it, please also grab factorio-current.log when it happens to you. :)
Also with my savegames there's nothing i could judge in others'. :D
How long does it usually take for the crash to happen?
well, when I first responded to this discussion (before I went to bed), it happened after ~18 minutes or so? or maybe more? I had sat around afk for a good chunk of the time with the game paused so I'm not sure, but I know I didn't get much done between adding the mod and getting the error. I did manage to get at least 3 autosaves off, only for the manual save to throw a fit.
since waking up today? hasn't thrown a fit at all. and I've been playing for ~an hour.
That's very useful info, thanks. Now i'm wondering if that's a result of the mod just getting initialized wrongly, but it gets fixed up after some time. Would be good to know if the crash actually happens again for you.
Thanks for the fast update. The mod is really a blessing!
Verbose output on autosave
5332.360 Error ParallelScenarioSaver.cpp:156: Saving scenario failed: The mod YARM - Resource Monitor (0.11.1) caused a non-recoverable error.
Please report this error to the mod author.Error while running event YARM::on_save()
Cannot serialise lua functions
I think that's the part you'd look for
Thanks, and i appreciate the effort. :)
Sadly that actually does not give any information we can use at this moment.
The savegame i tried to replicate with has been auto-saving every minute for 3 hours now and is doing fine.
I suspect right now it's an issue that happens near the start of a game and not again, but narc will look into it more and i have some ideas for changing the code to maybe find it.
fwiw the save I'm running into this on was also started with no mods, and I added this (and other) mods about 6 hours in
@ridesdragons I left your savegame running for 5 hours and it did not crash, so i'm moderately suspecting that the crash happens only once.
@fishsticksfred Appreciate the info. In my own game i did the same and was not able to reproduce it yet, so i'm not sure if that's a factor.
yea was just checking in to say that I hadn't experience the error at all today. weird bug. sorry I can't be of more help for finding it lol
@Icefair please supply your factorio-current.log (assuming you haven't rebooted the game since experiencing the bug), as that will have the info he needs. it's located in %appdata%/Factorio. if you have rebooted, but only once, factorio-previous.log might have the info
I can't make it crash either with either my save or yours (though I also didn't try for very long), and moreover on my quick look through the code I didn't spot anything obvious where we're trying to save something unexpected.
I will keep YARM on my own save and see if I can reproduce the issue but for now, it seems it will remain a mystery.
Oh, also, good news: @devdot updated the other Resource Monitor to 2.0 so there's a nice alternative available.
I spoke too soon, just after posting this I managed to find the reproduction steps: you have to be in the middle of adding a site (either scanning for resources or just waiting for the scan to time out). If it just sits there, nothing will go wrong, but if you (or anyone else, in multiplayer!) happen to be adding a site then the state of the game during this step includes some function somewhere in YARM's storage.
it's caused by marking a site? well that explains why I didn't get it today (I hadn't marked any new sites), but it's still weird that it happened yesterday, since I added the sites all at once and then proceeded to not touch the mod for a while. I certainly didn't try to save mid-adding. how long does it take for the scan to "time out"? I thought it was just until you hear the notification sound and it gets added to the list
I've since found the actual problem and posted on the Github issue, but there are in fact two cases: when adding a site (or extending), and periodically (relatively rarely) when site counts are updated.
It's very unlucky to hit the perfect timing for the latter, but once hit, the autosave frequency will probably make you get it again. Loading a save would change the timing and usually get you off the coincidence train.
I got something similar when I was initially doing ore patches. I did a bunch all in a row (very fast) and got the error. So do 10 patches really fast and have an autosave in the middle.
I can share a different experience. Played for a few hours with no issues, including auto-saves working fine. Hadn't added an ore patch in a while but was seeing that YARM reports my iron ore in the red with only 45 minutes remaining. Was about to log out for the day when this error came up, and I tried saving 3 times from the pause menu with no success. Unpaused, waited a few seconds, tried saving again and had no issue.
Log provides the following:
Error while running event YARM::on_save()
Cannot serialise lua functions
8814.194 Warning WriteFileGuard.cpp:52: Writing C:\Users*****\AppData\Roaming\Factorio\saves[space-location=solar-system-edge] Space Age.zip failed; previous version (if any) should still be available
8814.195 Error ParallelScenarioSaver.cpp:156: Saving scenario failed: The mod YARM - Resource Monitor (0.11.1) caused a non-recoverable error.
Please report this error to the mod author.
I know this has already been figured out, but figured I'd mention, just had the bug pop up for me again, except this time for the autosaves. tried manually saving and reloading to desync it as narc mentioned, but no dice, the autosaves continue to trigger the error. this only started happening after I added a couple more patches to my list. it's not a huge problem as I'm still technically early game (16 hours and still no oil, fun stuff lol) but I sure hope a fix gets implemented before I start caring about my autosaves. at least it sorta functions as a reminder to manually save I suppose.
in curiosity, I've checked the factorio-current.log after the bug triggered, but... it's even less helpful than the verbose message. and the verbose message isn't helpful at all lol. here's a snippet of the log from 4 autosaves before the bug to after I saved and reloaded: https://puu.sh/KhlW8/ab6030f2df.png
after I added a couple more patches
Yeah, the more ore sites (and the bigger they are), the longer it takes to enumerate all the sites, which means you're more likely to be in the middle of one when the autosave timer hits. You can mitigate it a bit by playing with the Ticks between resource updates setting (for example, I've got mine set at 620 and the autosave only rarely fails): https://i.imgur.com/GZQdAmo.png
The next YARM update should fix the problem, we hope.
I just released 0.11.2 which should fix this. :)
Awesome, thank you for the fix!