Closed fjpanag closed 6 months ago
Moonraker stores the job history in its database and modifies it twice: once when the job is started and again when its completed. The power failure prevented the last update, hence the appearance of it being "stuck". However this is purely cosmetic, it won't affect behavior in any way.
I don't know that Moonraker should be expected to attempt to correct historical data corrupted due to an abrupt shutdown, or at least I don't consider it a bug that it doesn't. That said, I do think that in this case it can be done reliably with no repercussions, so its something that could be added as an enhancement.
This should now be resolved in commit 09b6a33ae4d85c0eb17c775e413480d5117987d7.
@Arksine I totally understand that this is just cosmetic and not a functional issue.
But since it "lies" about a job being in a state that it is not, it is great if it can be fixed.
If you are worried that this may cause other issues, maybe a "repair" script can be provided that the user will run manually when and if needed?
Nevertheless, I tried https://github.com/Arksine/moonraker/commit/09b6a33ae4d85c0eb17c775e413480d5117987d7 and I can confirm that it works as intended. Thank you.
While checking in Mainsail, I see that this interrupted
state is not capitalized like the rest of them.
(See Canceled vs interrupted.)
I guess this is a front-end issue? That it doesn't recognize this new state maybe? Shall I go ahead and create an issue on Mainsail, to make them aware of this change?
The status
reported by Moonraker is not capitalized, so I believe that you are correct that Mainsail needs to make a change.
What happened
While printing I had a power failure that interrupted the job. The host computer (Raspberry Pi 4) was fully power cycled.
Upon restart, the interrupted job was stuck in the state "In Progress".
I printed successfully other jobs after the incident, which were correctly labelled as "In Progress" while printing and "Completed" when finished. But the problematic job is still in the wrong state.
What I would expect is moonraker to "recover" the interrupted job state to "Canceled" (or something similar) during the next boot.
Restarting moonraker or any other component, or fully rebooting the host didn't fix the issue.
Client
Mainsail, Fluidd
Browser
Firefox
How to reproduce
These are steps to reproduce, I believe (although I didn't test them):
reboot
).Additional information
Here is the history, as presented by Mainsail:
Here is a copy of the log file:
moonraker(1).log