Octoprint server file corruption after power failure

What is the problem?

Storm caused a power failure early this morning, can no longer access OctoPrint server via web interface.

What did you already try to solve it?

I have rebooted OctoPi from the cli. I have also stopped the OctoPrint service and restarted in safe mode (also via cli "sudo service octoprint stop" and "sudo service octopring start --safe"). Verified service was not running when stopped and running after being restarted ("sudo service octoprint status"). Octoprint.log indicates errors with several *.py files related to plugins, as well as server.py and init.py.

Have you tried running in safe mode?

Yes, continue to receive "OctoPrint server is currently not running" page at the IP4 address of my server.

Did running in safe mode solve the problem?

No

Complete Logs

octoprint.log (61.3 KB)


grep

octoprint.log seems to indicate an issue with 3-4 files related to plugins, as well as several files related to server initialization.

Additional information about your setup

OctoPrint v1.5.0
OctoPi v0.17.0
Server hardware: RPi 3B
Trying to access on x64 Win10 machine running x64 Chrome browser.

I backed up my home/pi/.octoprint folder about 6 months ago. I don' t believe I've added any plugins since that time. I also don't believe I've updated OctoPi since that time. I'm assuming that the .py files indicated in the octoprint.log were corrupted during the power failure (even though the server was not being accessed and no print ongoing). Is there a way to rebuild these files or might it be worth trying to restore them from the backup? If not, is my only recourse to rebuild from a fresh OctoPi image?

Try this to see if it works, to reinstall OctoPrint:

~/oprint/bin/pip install --force-reinstall --no-cache-dir octoprint

That may get rid of OctoPrint core errors, see if you can get into the server - it can handle plugins failing, that can come later.

Otherwise, the best place to go would be the ~/.octoprint folder again, since you will then be able to read out your settings again. The backup/restore built in just zips that up, with some metadata and a list of plugins to reinstall.

Unfortunately, the SD cards are susceptible to file corruption on power failure. Best remedies are either have a backup of the SD card, or move the root file system to a SSD on the USB port. the external USB drives don't corrupt from power failures.

Thanks all, I'm not having any luck forcing a reinstall (keeps exiting with -ll status) and restoring ~/.octoprint did not help either. I'm downloading v1.18 now and after I get it set up I'll start keeping a full image backup of the sd.

You can also look into the Backup Scheduler plugin, in combination with Google Drive Backup, or Webdav Backup plugin to upload them elsewhere. There may be other cloud backup plugins as well.