Unable to start octoprint after upgrade from 1.3.8 to 1.3.9 on pi 3+


#1

What is the problem?
Following what appears to be a successful update to 1.3.9 from 1.3.8 on an octopi. The octoprint service no longer starts. Looking at the logs the error appears to be:

[B2018-08-05 13:33:09,710 - octoprint.startup - INFO - ******************************************************************************
2018-08-05 13:33:09,712 - octoprint.startup - INFO - Starting OctoPrint 1.3.9
2018-08-05 13:33:09,714 - octoprint.startup - INFO - Starting in SAFE MODE. Third party plugins will be disabled!
2018-08-05 13:33:09,714 - octoprint.startup - INFO - ******************************************************************************
2018-08-05 13:33:10,815 - octoprint.util.connectivity_checker - INFO - Connectivity changed from offline to online
2018-08-05 13:33:11,003 - octoprint.startup - INFO - Blacklist processing done
2018-08-05 13:33:11,039 - 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...
2018-08-05 13:33:11,401 - octoprint.plugin.core - ERROR - Error loading plugin softwareupdate
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 847, in _import_plugin
    instance = imp.load_module(key, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/softwareupdate/__init__.py", line 26, in <module>
    from octoprint.server.util.flask import restricted_access, with_revalidation_checking, check_etag
  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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:11,439 - 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 847, in _import_plugin
    instance = imp.load_module(key, 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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:11,463 - octoprint.plugin.core - ERROR - Error loading plugin logging
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 847, in _import_plugin
    instance = imp.load_module(key, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/logging/__init__.py", line 10, in <module>
    from octoprint.server import NO_CONTENT, admin_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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:11,533 - octoprint.plugin.core - ERROR - Error loading plugin pluginmanager
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 847, in _import_plugin
    instance = imp.load_module(key, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/pluginmanager/__init__.py", line 14, in <module>
    from octoprint.server.util.flask import restricted_access, with_revalidation_checking, check_etag
  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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:11,704 - octoprint.plugin.core - ERROR - Error loading plugin announcements
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 847, in _import_plugin
    instance = imp.load_module(key, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/announcements/__init__.py", line 23, in <module>
    from octoprint.server import admin_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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:11,780 - octoprint.plugin.core - ERROR - Error loading plugin printer_safety_check
Traceback (most recent call last):
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/plugin/core.py", line 847, in _import_plugin
    instance = imp.load_module(key, f, filename, description)
  File "/home/pi/oprint/lib/python2.7/site-packages/octoprint/plugins/printer_safety_check/__init__.py", line 10, 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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch
2018-08-05 13:33:12,412 - octoprint.plugin.core - INFO - Found 11 plugin(s) providing 5 mixin implementations, 1 hook handlers
2018-08-05 13:33:12,518 - octoprint.cli.server - ERROR - Uncaught exception
Traceback (most recent call last):
  File "/home/pi/oprint/bin/octoprint", line 11, in <module>
    sys.exit(main())
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/__init__.py", line 599, in main
    octo(args=args, prog_name="octoprint", auto_envvar_prefix="OCTOPRINT")
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 1037, in invoke
    return Command.invoke(self, ctx)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/cli/__init__.py", line 175, in octo
    ctx.invoke(serve_command, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 188, in serve_command
    ignore_blacklist)
  File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/cli/server.py", line 97, in run_server
    from octoprint.server import Server
  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 85, in <module>
    from tornado import gen
  File "/home/pi/oprint/local/lib/python2.7/site-packages/tornado/gen.py", line 99, in <module>
    from singledispatch import singledispatch  # backport
ImportError: cannot import name singledispatch

What did you already try to solve it?
I have tried to start it in safe mode, I reverted back to 1.3.8 and it worked fine but upgrading again caused the problem,

Any help would be wonderful

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)
Octopi version
OctoPrint version : 1.3.9
OctoPi version : 0.15.1


#2

I have decided it reinstall octopi from scratch and the update works well