OctoPrint on Raspbian will hang during startup

After using OctoPi for a long time, I have just installed OctoPrint on Raspbian (using the instructions below) to run alongside a pihole. However, I can't get OctoPrint to start up.

After "octopring serve" it essentially stalls at the point shown below, and after that a line with "heartbeat" will show up every 15 minutes.

I have tried reinstalling, going through the instructions from the beginning, doesn't help.

What am I doing wrong? Many thanks in advance for pointers!

(venv) pi@RaspberryPi4-2:~ $ octoprint serve
2020-04-13 17:52:08,342 - octoprint.startup - INFO - ******************************************************************************
2020-04-13 17:52:08,344 - octoprint.startup - INFO - Starting OctoPrint 1.4.0
2020-04-13 17:52:08,344 - octoprint.startup - INFO - ******************************************************************************
2020-04-13 17:52:08,642 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2020-04-13 17:52:09,258 - octoprint.plugins.octoprint.plugins.discovery - INFO - pybonjour is not installed, Zeroconf Discovery won't be available
2020-04-13 17:52:09,266 - octoprint.plugin.core - INFO - Found 15 plugin(s) providing 15 mixin implementations, 27 hook handlers
2020-04-13 17:52:09,333 - octoprint.server.heartbeat - INFO - Starting server heartbeat, 900.0s interval
2020-04-13 17:52:09,349 - octoprint.server - INFO - Intermediary server started
2020-04-13 17:52:09,350 - octoprint.plugin.core - INFO - Loading plugins from /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins, /home/pi/.octoprint/plugins and installed plugin packages...
2020-04-13 17:52:09,409 - octoprint.plugin.core - INFO - Found 15 plugin(s) providing 15 mixin implementations, 27 hook handlers
2020-04-13 17:52:09,427 - octoprint.filemanager.storage - INFO - Initializing the file metadata for /home/pi/.octoprint/uploads...
2020-04-13 17:52:09,428 - octoprint.filemanager.storage - INFO - ... file metadata for /home/pi/.octoprint/uploads initialized successfully.
2020-04-13 17:52:09,431 - octoprint.server - INFO - Added new permission from plugin action_command_prompt: PLUGIN_ACTION_COMMAND_PROMPT_INTERACT (needs: u"Need(method='role', value=u'plugin_action_command_prompt_interact')")
2020-04-13 17:52:09,431 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_READ (needs: u"Need(method='role', value=u'plugin_announcements_read')")
2020-04-13 17:52:09,432 - octoprint.server - INFO - Added new permission from plugin announcements: PLUGIN_ANNOUNCEMENTS_MANAGE (needs: u"Need(method='role', value=u'plugin_announcements_manage'), Need(method='role', value=u'plugin_announcements_read')")
2020-04-13 17:52:09,434 - octoprint.server - INFO - Added new permission from plugin appkeys: PLUGIN_APPKEYS_ADMIN (needs: u"Need(method='role', value=u'plugin_appkeys_admin')")
2020-04-13 17:52:09,434 - octoprint.server - INFO - Added new permission from plugin backup: PLUGIN_BACKUP_ACCESS (needs: u"Need(method='role', value=u'plugin_backup_access')")
2020-04-13 17:52:09,435 - octoprint.server - INFO - Added new permission from plugin logging: PLUGIN_LOGGING_MANAGE (needs: u"Need(method='role', value=u'plugin_logging_manage')")
2020-04-13 17:52:09,436 - octoprint.server - INFO - Added new permission from plugin pi_support: PLUGIN_PI_SUPPORT_STATUS (needs: u"Need(method='role', value=u'plugin_pi_support_check')")
2020-04-13 17:52:09,436 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_MANAGE (needs: u"Need(method='role', value=u'plugin_pluginmanager_manage')")
2020-04-13 17:52:09,438 - octoprint.server - INFO - Added new permission from plugin pluginmanager: PLUGIN_PLUGINMANAGER_INSTALL (needs: u"Need(method='role', value=u'plugin_pluginmanager_install'), Need(method='role', value=u'plugin_pluginmanager_manage')")
2020-04-13 17:52:09,438 - octoprint.server - INFO - Added new permission from plugin printer_safety_check: PLUGIN_PRINTER_SAFETY_CHECK_DISPLAY (needs: u"Need(method='role', value=u'plugin_printer_safety_check_display')")
2020-04-13 17:52:09,439 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_CHECK (needs: u"Need(method='role', value=u'plugin_softwareupdate_check')")
2020-04-13 17:52:09,440 - octoprint.server - INFO - Added new permission from plugin softwareupdate: PLUGIN_SOFTWAREUPDATE_UPDATE (needs: u"Need(method='role', value=u'plugin_softwareupdate_update')")
2020-04-13 17:52:09,468 - octoprint.plugins.softwareupdate - INFO - Loaded version cache from disk
2020-04-13 17:52:09,931 - octoprint.util.pip - INFO - Using "/home/pi/venv/bin/python2 -m pip" as command to invoke pip
2020-04-13 17:52:10,389 - octoprint.util.pip - INFO - Version of pip is 20.0.2
2020-04-13 17:52:10,391 - octoprint.util.pip - INFO - pip installs to /home/pi/venv/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2020-04-13 17:52:10,391 - octoprint.util.pip - INFO - ==> pip ok -> yes
2020-04-13 17:52:10,394 - octoprint.plugin.core - INFO - Initialized 15 plugin implementation(s)
2020-04-13 17:52:10,400 - octoprint.plugin.core - INFO - 15 plugin(s) registered with the system:
| Action Command Prompt Support (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/action_command_prompt
| Announcement Plugin (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/announcements
| Anonymous Usage Tracking (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/tracking
| Application Keys Plugin (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/appkeys
| Backup & Restore (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/backup
| Core Wizard (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/corewizard
| Discovery (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/discovery
| Error Tracking (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/errortracking
| Logging (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/logging
| Login UI (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/loginui
| Pi Support Plugin (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/pi_support
| Plugin Manager (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/pluginmanager
| Printer Safety Check (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/printer_safety_check
| Software Update (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/softwareupdate
| Virtual Printer (bundled) = /home/pi/venv/lib/python2.7/site-packages/octoprint/plugins/virtual_printer
Prefix legend: ! = disabled, # = blacklisted, * = incompatible
2020-04-13 17:52:10,410 - octoprint.environment - INFO - Detected environment is Python 2.7.16 under Linux (linux2). Details:
| hardware:
| cores: 4
| freq: 1500.0
| ram: 969359360
| os:
| id: linux
| platform: linux2
| plugins:
| pi_support:
| model: Raspberry Pi 4 Model B Rev 1.1
| python:
| pip: 20.0.2
| version: 2.7.16
| virtualenv: /home/pi/venv
2020-04-13 17:52:10,415 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/webassets...
2020-04-13 17:52:10,416 - octoprint.server - INFO - Reset webasset folder /home/pi/.octoprint/generated/.webassets-cache...
2020-04-13 17:52:10,852 - octoprint.server - INFO - Shutting down intermediary server...
2020-04-13 17:52:10,855 - octoprint.server - INFO - Intermediary server shut down
2020-04-13 17:52:10,858 - octoprint.events - INFO - Processing startup event, this is our first event
2020-04-13 17:52:10,858 - octoprint.events - INFO - Adding 0 events to queue that were held back before startup event
2020-04-13 17:52:10,860 - octoprint.filemanager - INFO - Adding backlog items from all storage types to analysis queue...
2020-04-13 17:52:10,862 - octoprint.server.util.watchdog - INFO - Running initial scan on watched folder...
2020-04-13 17:52:10,875 - octoprint.server.util.watchdog - INFO - ... initial scan done.
2020-04-13 17:52:10,879 - octoprint.plugins.discovery - INFO - Registered OctoPrint instance on RaspberryPi4-2 for SSDP
2020-04-13 17:52:10,880 - octoprint.filemanager - INFO - Added 0 items from storage type "local" to analysis queue
2020-04-13 17:52:10,891 - octoprint.server - INFO - Listening on http://0.0.0.0:5000 and http://[::]:5000
2020-04-13 17:52:10,947 - octoprint.plugins.pluginmanager - INFO - Loaded plugin repository data from disk, was still valid
2020-04-13 17:52:11,599 - octoprint.util.pip - INFO - Using "/home/pi/venv/bin/python2 -m pip" as command to invoke pip
2020-04-13 17:52:11,601 - octoprint.util.pip - INFO - pip installs to /home/pi/venv/lib/python2.7/site-packages (writable -> yes), --user flag needed -> no, virtual env -> yes
2020-04-13 17:52:11,650 - octoprint.util.pip - INFO - ==> pip ok -> yes
2020-04-13 17:52:11,711 - octoprint.plugins.pluginmanager - INFO - Loaded notice data from disk, was still valid
2020-04-13 17:52:12,349 - octoprint.util.pip - INFO - Using "/home/pi/venv/bin/python2 -m pip" as command to invoke pip
2020-04-13 17:52:14,061 - octoprint.util.pip - INFO - pip installs to /home/pi/venv/lib/python2.7/site-packages/ (writable -> yes), --user flag needed -> no, virtual env -> yes
2020-04-13 17:52:14,062 - octoprint.util.pip - INFO - ==> pip ok -> yes
2020-04-13 17:52:14,072 - octoprint.plugins.softwareupdate - INFO - Saved version cache to disk

Did you connect to the right port for the WebUI?

Good question, frankly I didn't even think to try to connect to OctoPrint because I thought it was hung and didn't start. So I tried and it seems that OctoPrint is actually running after it "hangs" on the heartbeat line - but i never get the linux prompt back. (And if I hit ctrl-c, it stops OctoPrint.) How can I start OctoPrint "in the background" and get back to the linux prompt? I am no linux expert. :frowning:

You need to set it up as a system service.

In that case I'd suggest to go with the preconfigured image OctoPi, because otherwise this will just be a painful and frustrating experience.

1 Like