OctoPrint failing to load after restarting my Pi (Error logs with Tornado)

What is the problem?

I was printing earlier today without any problem, using a Logitech C270 for timelapse. I unplugged my camera to install a modification, and rebooted my Pi because when I plugged it back in, it wouldn't display. It was like the camera wasn't autodetected. No big deal, I'll just reboot the Pi!

Now, I can't get it to boot into safemode, or regular mode. The logs seem to show the same package throwing errors for every plugin. Not sure if the Tornado devs recently updated it and this is a problem for other people as well, or if I'm just lucky. Anybody have any ideas?

What did you already try to solve it?

Rebooted, removed the camera, tried to boot to safemode, unplugged and replugged all cables, etc. I even updated OctoPi to the latest via the command line updating steps. I'm not a Python dude, so I don't know too much about the packages, but it seems like a dependency is all messed up now considering that package is missing whenever it tries to load any plugin. dmesg doesn't show any problems either.

Logs (syslog, dmesg, ...)
Snippet:

019-07-16 14:57:04,931 - octoprint.startup - INFO - ******************************************************************************
2019-07-16 14:57:04,933 - octoprint.startup - INFO - Starting OctoPrint 1.3.11
2019-07-16 14:57:04,934 - octoprint.startup - INFO - Starting in SAFE MODE. Third party plugins will be disabled!
2019-07-16 14:57:04,935 - octoprint.startup - INFO - Reason for safe mode: command line flag
2019-07-16 14:57:04,936 - octoprint.startup - INFO - ******************************************************************************
2019-07-16 14:57:04,999 - octoprint.util.connectivity_checker - INFO - Connectivity changed from offline to online
2019-07-16 14:57:05,004 - octoprint.startup - INFO - Blacklist processing done, adding 1 blacklisted plugin versions: roomtemp (any)
2019-07-16 14:57:05,044 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2019-07-16 14:57:05,158 - octoprint.plugin.core - ERROR - Error loading plugin action_command_prompt
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 863, in _import_plugin
    instance = imp.load_module(module_name, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/action_command_prompt/__init__.py", line 9, in <module>
    from octoprint.server import user_permission
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/__init__.py", line 9, in <module>
    from octoprint.vendor.sockjs.tornado import SockJSRouter
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/__init__.py", line 3, in <module>
    from .router import SockJSRouter
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/router.py", line 11, in <module>
    from octoprint.vendor.sockjs.tornado import transports, session, sessioncontainer, static, stats, proto
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/transports/__init__.py", line 3, in <module>
    import octoprint.vendor.sockjs.tornado.transports.pollingbase
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/transports/pollingbase.py", line 9, in <module>
    from octoprint.vendor.sockjs.tornado import basehandler
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/basehandler.py", line 13, in <module>
    from tornado.web import asynchronous, RequestHandler
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 93, in <module>
    from tornado.routing import (AnyMatches, DefaultHostMatches, HostMatches,
ImportError: cannot import name AnyMatches
2019-07-16 14:57:05,561 - octoprint.plugin.core - ERROR - Error loading plugin appkeys
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 863, in _import_plugin
    instance = imp.load_module(module_name, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/appkeys/__init__.py", line 16, in <module>
    from octoprint.server.util.flask import restricted_access, no_firstrun_access
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/server/__init__.py", line 9, in <module>
    from octoprint.vendor.sockjs.tornado import SockJSRouter
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/__init__.py", line 3, in <module>
    from .router import SockJSRouter
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/router.py", line 11, in <module>
    from octoprint.vendor.sockjs.tornado import transports, session, sessioncontainer, static, stats, proto
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/transports/__init__.py", line 3, in <module>
    import octoprint.vendor.sockjs.tornado.transports.pollingbase
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/transports/pollingbase.py", line 9, in <module>
    from octoprint.vendor.sockjs.tornado import basehandler
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/vendor/sockjs/tornado/basehandler.py", line 13, in <module>
    from tornado.web import asynchronous, RequestHandler
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/web.py", line 93, in <module>
    from tornado.routing import (AnyMatches, DefaultHostMatches, HostMatches,
ImportError: cannot import name AnyMatches

I'm guessing that this somehow has jacked something (tornado?) Tornado is a part of many of the bundled plugins to include the Action Command Prompt. Running in Safe Mode will still attempt to run all these. If something is systemically wrong with the image then it could behave like this.

Did you attempt to do something like sudo apt-get dist-upgrade perhaps? That would have applied the Raspbian Buster operating system upgrade and that could be the cause.

Naw, unfortunately I didn’t do anything but reboot the Pi. All I did to update it was run the normal commands from the docs. It was throwing the errors ahead of the update process even. Is it possible the hard reboot (I just turned it off by powering it off) could corrupt the Octopi instance?... Should I try and reinstall the whole image?

Yes, that is entirely possible. Somewhat unlucky that it corrupted a file that’s so integral for OctoPrint, but pulling the power can do that.

Which is why you shoulder never ever just pull power.

I reflashed it and everything is back to normal. Must have corrupted it from a hard reboot. Thanks all!

1 Like