Octoprint not starting after Trixie upgrade

Creating a bug report/issue

I have searched the existing open and closed issues

Required Information

  • DietPi version | cat /boot/dietpi/.version

    G_DIETPI_VERSION_CORE=9
    G_DIETPI_VERSION_SUB=19
    G_DIETPI_VERSION_RC=2
    G_GITBRANCH=‘master’
    G_GITOWNER=‘MichaIng’

  • Distro version | echo $G_DISTRO_NAME $G_RASPBIAN

    trixie

  • Kernel version | uname --all

    Linux DietPi 6.12.57-current-rockchip64 #1 SMP PREEMPT Sun Nov 2 13:15:23 UTC 2025 aarch64 GNU/Linux

  • Architecture | dpkg --print-architecture

    arm64

  • SBC model | echo $G_HW_MODEL_NAME or (EG: RPi3)

    ROCK 4 (aarch64)

  • Power supply used | (EG: 5V 1A RAVpower)

    USB-C power supply

  • SD card used | (EG: SanDisk ultra)

    Onboard EMMC

Additional Information (if applicable)

  • Software title | (EG: Nextcloud)

    Octoprint

  • Was the software title installed freshly or updated/migrated?

    Octoprint is the same, OS upgraded from bookworm to trixie

  • Can this issue be replicated on a fresh installation of DietPi?

    Not tried…

    ← If you sent a “dietpi-bugreport”, please paste the ID here →

  • Bug report ID | echo $G_HW_UUID

    323a7fd9-08f7-441b-9787-0fb6743c0df7

Steps to reproduce

  1. Have a working dietpi and Octoprint install on bookworm (with no available updates)

  2. Upgrade OS to trixie by running

sudo bash -c "$(curl -sSf 'https://raw.githubusercontent.com/MichaIng/DietPi/dev/.meta/dietpi-trixie-upgrade')"
  1. Follow onscreen instructions and assure no errors are present

  2. Wait until ‘You have successfully been upgraded to Trixie’ (or similar) message appears and all install steps are done.

  3. Reboot device

  4. Octoprint won’t start

Expected behaviour

  • Octoprint starts as usual automatically after a (re)boot or after manually running octoprint serve

Actual behaviour

  • Octoprint is not started automatically, and starting it manually throws an error.

Extra details

  • the following error is shown:
  root@DietPi:\~# octoprint serve
  2025-11-23 23:21:57,341 - octoprint.startup - CRITICAL - There was a fatal error initializing OctoPrint:
  Traceback (most recent call last):
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 96, in init_platform
  settings = init_settings(basedir, configfile, overlays=overlays)
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 209, in init_settings
  from octoprint.settings import InvalidSettings, settings
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/settings/**init**.py”, line 36, in
  from octoprint.schema.config import Config
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/schema/config/**init**.py”, line 7, in
  from octoprint.vendor.with_attrs_docs import with_attrs_docs
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/vendor/with_attrs_docs.py”, line 7, in
  from .class_doc import extract_docs_from_cls_obj
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/vendor/class_doc.py”, line 14, in
  import more_itertools as mitertools
  ModuleNotFoundError: No module named ‘more_itertools’


  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/cli/server.py”, line 112, in run_server
  components = init_platform(
  basedir,
  …<10 lines>…
  disable_color=disable_color,
  )
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 98, in init_platform
  raise FatalStartupError(“Could not initialize settings manager”, cause=ex) from ex
  octoprint.FatalStartupError: Could not initialize settings manager: No module named ‘more_itertools’
  Traceback (most recent call last):
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 96, in init_platform
  settings = init_settings(basedir, configfile, overlays=overlays)
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 209, in init_settings
  from octoprint.settings import InvalidSettings, settings
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/settings/**init**.py”, line 36, in
  from octoprint.schema.config import Config
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/schema/config/**init**.py”, line 7, in
  from octoprint.vendor.with_attrs_docs import with_attrs_docs
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/vendor/with_attrs_docs.py”, line 7, in
  from .class_doc import extract_docs_from_cls_obj
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/vendor/class_doc.py”, line 14, in
  import more_itertools as mitertools
  ModuleNotFoundError: No module named ‘more_itertools’

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/cli/server.py”, line 112, in run_server
  components = init_platform(
  basedir,
  …<10 lines>…
  disable_color=disable_color, )
  File “/mnt/dietpi_userdata/octoprint/.local/lib/python3.13/site-packages/octoprint/**init**.py”, line 98, in init_platform
  raise FatalStartupError(“Could not initialize settings manager”, cause=ex) from ex
  octoprint.FatalStartupError: Could not initialize settings manager: No module named ‘more_itertools’

  There was a fatal error initializing OctoPrint: Could not initialize settings manager: No module named ‘more_itertools’

Thanks in advance for your help!

You probably installed a plugin which requires this additional module. Please try this:

sudo -u octoprint pip3 install -U --user more_itertools

But I’m running test installs to assure it is no core dependency that has been missed to be declared as such in OctoPrint or one of its dependencies: DietPi-Software test · MichaIng/DietPi@77e6c78 · GitHub

The import is actually done here:

And that package declares it as dependency:

OctoPrint vendors it in:

But does not declare it as dependency:

My install tests all succeed, so looks like this is called only in certain conditions.

It is imported here:

That however is imported at a lot of places: Code search results · GitHub

Hmm, in my logs the module is actually installed:

Collecting more-itertools>=10.5.0 (from octoprint)
  Downloading more_itertools-10.8.0-py3-none-any.whl.metadata (39 kB)

Ahh oh OctoPrint DOES define it as dependency, just with dash instead of underscore (which both works):

Okay, so why was it not installed in your case? :thinking:

If you did not install it manually yet, what does this return?

sudo -u octoprint pip3 freeze --user
1 Like

Thanks @MichaIng for your quick reply, that was some interesting detective work to read through :stuck_out_tongue:

Okay, so why was it not installed in your case? :thinking:

If you did not install it manually yet, what does this return?

sudo -u octoprint pip3 freeze --user

I didn’t try to manually install it yet, so the situation is still the same. Running that command returns the following (formatted properly now, thanks :sweat_smile: ) :

root@DietPi:~# sudo -u octoprint pip3 freeze --user
annotated-types==0.7.0
argon2-cffi==25.1.0
argon2-cffi-bindings==25.1.0
babel==2.16.0
blinker==1.8.2
cachelib==0.13.0
cffi==2.0.0
click==8.2.1
colorlog==6.10.1
Deprecated==1.3.1
emoji==2.15.0
feedparser==6.0.12
filetype==1.2.0
Flask==3.0.3
Flask-Assets==2.1.0
flask-babel==4.0.0
Flask-Limiter==3.8.0
Flask-Login==0.6.3
frozendict==2.4.7
future==1.0.0
ifaddr==0.2.0
itsdangerous==2.2.0
Jinja2==3.1.6
libpass==1.9.3
limits==4.8.0
Markdown==3.7
markdown-it-py==4.0.0
MarkupSafe==3.0.3
mdurl==0.1.2
netaddr==1.3.0
netifaces==0.11.0
OctoPrint==1.11.4
OctoPrint-FileCheck==2025.7.23
OctoPrint-FirmwareCheck==2025.7.23
OctoPrint-PiSupport==2025.7.23
ordered-set==4.1.0
packaging==24.2
pathvalidate==3.3.1
psutil==6.1.1
pycparser==2.23
pydantic==2.12.4
pydantic_core==2.41.5
Pygments==2.19.2
pylru==1.2.1
pyserial==3.5
PyYAML==6.0.3
regex==2025.11.3
rich==13.9.4
sarge==0.1.7.post1
semantic-version==2.10.0
sentry-sdk==2.45.0
setuptools==80.9.0
sgmllib3k==1.0.0
tornado==6.5.2
typing-inspection==0.4.2
typing_extensions==4.15.0
Unidecode==1.4.0
watchdog==4.0.2
webassets==3.0.0
websocket-client==1.8.0
Werkzeug==3.0.6
wheel==0.45.1
wrapt==1.17.3
zeroconf==0.136.2
zipstream-ng==1.9.0
zope.dottedname==7.0

So here is a diff between your and my fresh install:

--- you     2025-11-24 12:58:59.668007157 +0100
+++ me      2025-11-24 12:59:09.324007570 +0100
@@ -4,7 +4,9 @@
 babel==2.16.0
 blinker==1.8.2
 cachelib==0.13.0
+certifi==2025.11.12
 cffi==2.0.0
+charset-normalizer==3.4.4
 click==8.2.1
 colorlog==6.10.1
 Deprecated==1.3.1
@@ -18,6 +20,7 @@
 Flask-Login==0.6.3
 frozendict==2.4.7
 future==1.0.0
+idna==3.11
 ifaddr==0.2.0
 itsdangerous==2.2.0
 Jinja2==3.1.6
@@ -27,6 +30,7 @@
 markdown-it-py==4.0.0
 MarkupSafe==3.0.3
 mdurl==0.1.2
+more-itertools==10.8.0
 netaddr==1.3.0
 netifaces==0.11.0
 OctoPrint==1.11.4
@@ -43,18 +47,21 @@
 Pygments==2.19.2
 pylru==1.2.1
 pyserial==3.5
+pytz==2025.2
 PyYAML==6.0.3
 regex==2025.11.3
+requests==2.32.5
 rich==13.9.4
 sarge==0.1.7.post1
 semantic-version==2.10.0
-sentry-sdk==2.45.0
+sentry-sdk==2.46.0
 setuptools==80.9.0
 sgmllib3k==1.0.0
 tornado==6.5.2
 typing-inspection==0.4.2
 typing_extensions==4.15.0
 Unidecode==1.4.0
+urllib3==2.5.0
 watchdog==4.0.2
 webassets==3.0.0
 websocket-client==1.8.0

Hence some more modules are missing in your case :thinking:. These are all dependencies of OctoPrint, directly or as dependency tail clearly declared. I have no other explanation than that the installation aborted somewhere in the middle. Probably we should error-handle the dietpi-software call, but you should have seen an error prompt since the OctoPrint module install itself is error-handled.

However, let’s see is repeating this adds the missing modules:

sudo -u octoprint pip3 install -U --user octoprint

That’s interesting to say at least… Running the command you mentioned only installed the more_itertools package though, not the other differences you mentioned.

Downloading more_itertools-10.8.0-py3-none-any.whl (69 kB)
Installing collected packages: more-itertools
Successfully installed more-itertools-10.8.0

Octoprint is booting afterwards, but it seems that all the 3rd-party plugins are not loaded…

Before the current Rock 4 board, Octoprint was running on a Raspberry Pi 3 with an SD-card, not using DietPi (OctoPi). After getting all kinds of strange errors, I eventually migrated to the Rock 4 board (with eMMC) and for this new board, I switched over to DietPi. However, I didn’t start over with a ‘fresh’ Octoprint install, but instead created a back-up of Octoprint and simply restored that back-up after installing Octoprint through DietPi. I’m starting to suspect that maybe something was already broken (due to the faulty SD card on the Pi) already before installing DietPi, and the back-up and restore procedure simply copied those errors over to my current DietPi installation…

I think I’ll start over with a fresh Octoprint install, and this time, instead of restoring a back-up I’ll just configure everything manually again. Whatever the actual problem is, I’m almost sure that DietPi is not to blame in this case :slight_smile: Thanks for all the help though!

I can check what the output of pip freeze is after a fresh install, will report back later!

1 Like

So e.g. the requests module is still not installed? A direct dependency of the OctoPrint module:

https://github.com/OctoPrint/OctoPrint/blob/32f7dfb5dcbd15d75de1b814ae57aeb5dbec0726/pyproject.toml#L90

You can also check via:

ls -l /mnt/dietpi_userdata/octoprint/.local/lib/python3.*/site-packages/requests

Ah, one other explanation is that this module is installed on system level:

sudo pip3 freeze

In this case, it would not be needed in the user site anymore.


I found the reason why restoring the backup does not restore all plugins. There was/is a bug with some/many plugins which need an update to install successfully with recent pip versions. OctoPrint has a workaround for this in place when installing new plugins via plugin manager or via CLI, but that workaround is still missing when restoring backups or a plugin list JSON export:

The plugins are simply not installed, you will see the failure in the logs as well, but the GUI does not make this exactly visible well, no error prompt or such there. But you can just install them via plugin manager again, data and configs are still in place.

After the fresh install, more-itertools is installed normally as expected. The other packages (e.g. request are indeed installed on system-level (they show up when sudo pip3 freeze).

Perhaps I could have done without the fresh install, but it seems that also fixed some other longstanding issues :slight_smile: Thanks again for the help, and also thanks for actively supporting Octoprint on DietPi!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.