bitsy-ai / printnanny-os

Image repository, change logs, and issue tracking for PrintNanny OS
GNU Affero General Public License v3.0
23 stars 2 forks source link

Crash report tool fails if any of Mainsail/Moonraker/Klipper services are disabled #286

Closed leigh-johnson closed 1 year ago

leigh-johnson commented 1 year ago

Describe the bug

If you attempt to generate a crash report with mainsail/moonraker/klipper disabled, the report will fail with an error:

[2023-02-26T05:31:35Z ERROR printnanny_services::crash_report] Failed to read file=/var/log/klipper/ error=No such file or directory (os error 2), unable to copy file to crash report zip
[2023-02-26T05:31:35Z ERROR printnanny_services::crash_report] Failed to read file=/var/log/moonraker/ error=No such file or directory (os error 2), unable to copy file to crash report zip

We gracefully handle missing files in the crash report tool, but not missing folders

leigh-johnson commented 1 year ago

🎉 Fixed in the latest v0.6.6 nightly

travelpi:~$ sudo rm -rf /var/log/moonraker/
travelpi:~$ sudo -u printnanny printnanny crash-report
[2023-02-27T11:41:03Z WARN  printnanny_services::crash_report] Path /var/log/moonraker/ does not exist and will not be included in crash report
[2023-02-27T11:41:09Z WARN  printnanny_services::printnanny_api] Wrote crash report logs to /tmp/crash-reportPryFqC.zip
[2023-02-27T11:41:11Z WARN  printnanny_services::printnanny_api] Finished uploading /tmp/crash-reportPryFqC.zip, removing file
Submitted crash report:
....