Moonraker won't come up properly

Basic Information:

Printer Model: N/A
MCU / Printerboard: BTT SKR Mini E3 V3
Host / SBC: Orange Pi zero 2W/Raspberry Pi Zero 2W
klippy.log (20.4 KB)
moonraker.log (2.1 MB)

I’m trying to pull together the requested information for my previous request:

I have successfully erased the BTT SKR Mini E3 V3 and the DFU USB id (0483:df11) comes up without any issue. I’m able to load Katapul or Klipper without any issue (I turn on/off the STATUS LED in the firmware build to see that it’s a) working and b) different from the last time I loaded the firmware).

But, when I try to access the Mainsail web page, I get a Moonraker error:

Looking at moonraker.log (attached) I continually get:

2024-08-03 02:51:28,070 [server.py:load_component()] - Unable to load component: (authorization)
Traceback (most recent call last):
  File "/home/biqu/moonraker/moonraker/server.py", line 298, in load_component
    module = importlib.import_module(full_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/biqu/moonraker/moonraker/components/authorization.py", line 21, in <module>
    from libnacl.sign import Signer, Verifier
  File "/home/biqu/moonraker-env/lib/python3.11/site-packages/libnacl/__init__.py", line 87, in <module>
    nacl = _get_nacl()
           ^^^^^^^^^^^
  File "/home/biqu/moonraker-env/lib/python3.11/site-packages/libnacl/__init__.py", line 83, in _get_nacl
    raise OSError(msg)
OSError: Could not locate nacl lib, searched for libsodium.so, libsodium.so.23, libsodium.so.18, libsodium.so.17, libsodium.so.13, libsodium.so.10, libsodium.so.5, libsodium.so.4, 
2024-08-03 02:51:28,070 [server.py:main()] - Moonraker Error
Traceback (most recent call last):
  File "/home/biqu/moonraker/moonraker/server.py", line 670, in main
    server.load_components()
  File "/home/biqu/moonraker/moonraker/server.py", line 269, in load_components
    self.load_component(config, component)
  File "/home/biqu/moonraker/moonraker/server.py", line 298, in load_component
    module = importlib.import_module(full_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The loading process I use for both the Orange Pi Zero 2W (I tried two of them) as well as a genuine Raspberry Pi Zero 2W from SSH is:

  1. sudo apt-get update && sudo apt-get install git -y
  2. git clone https://github.com/dw-0/kiauh.git
  3. I then run ./kiauh/kiauh.sh and install Klipper, Moonraker and Mainsail without any issues.
  4. I try to access the Mainsail web page and I get the failure above?

I’m trying to figure out what I’m doing wrong, but it’s a pretty simple process and I haven’t had issues with it before.

Any idea where I’m screwing up?

What is your Linux distribution and Python version?

For the Orange Pi, it’s the latest Debian Linux 6.1 Kernel image on the Orange Pi site:

http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/service-and-support/Orange-Pi-Zero-2W.html

For the Raspberry Pi, it’s the latest 64bit “Lite” version available on the Raspberry Pi Imager.

For me it looks like some dependencies are not correctly installed.
What happens if you manually run:

~/moonraker/scripts/install-moonraker.sh

Does it cleanly run?

1 Like

That seemed to have fixed it:

biqu@serial-test:~ $ ~/moonraker/scripts/install-moonraker.sh
Installing from Moonraker source...
Found Linux distribution IDs: debian
Distribution detected: debian


###### Running apt-get update...
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian-security bookworm-security InRelease
Get:3 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
Hit:4 http://archive.raspberrypi.com/debian bookworm InRelease
Fetched 55.4 kB in 2s (23.1 kB/s)
Reading package lists... Done


###### Installing Moonraker Dependencies:


###### python3-virtualenv python3-dev libopenjp2-7 libsodium-dev zlib1g-dev libjpeg-dev packagekit wireless-tools curl build-essential
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-virtualenv is already the newest version (20.17.1+ds-1).
python3-virtualenv set to manually installed.
python3-dev is already the newest version (3.11.2-1+b1).
zlib1g-dev is already the newest version (1:1.2.13.dfsg-1).
zlib1g-dev set to manually installed.
libjpeg-dev is already the newest version (1:2.1.5-2).
wireless-tools is already the newest version (30~pre9-14).
curl is already the newest version (7.88.1-10+deb12u6).
build-essential is already the newest version (12.9).
The following additional packages will be installed:
  appstream libappstream4 libglib2.0-bin libglib2.0-data libgstreamer1.0-0 libpackagekit-glib2-18 libsodium23
  libstemmer0d libxmlb2 packagekit-tools
Suggested packages:
  apt-config-icons gstreamer1.0-tools
The following NEW packages will be installed:
  appstream libappstream4 libglib2.0-bin libglib2.0-data libgstreamer1.0-0 libopenjp2-7 libpackagekit-glib2-18
  libsodium-dev libsodium23 libstemmer0d libxmlb2 packagekit packagekit-tools
0 upgraded, 13 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,282 kB of archives.
After this operation, 25.0 MB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main arm64 libstemmer0d arm64 2.2.0-2 [112 kB]
Get:2 http://deb.debian.org/debian bookworm/main arm64 libxmlb2 arm64 0.3.10-2 [55.5 kB]
Get:3 http://deb.debian.org/debian bookworm/main arm64 libappstream4 arm64 0.16.1-2 [182 kB]
Get:4 http://deb.debian.org/debian bookworm/main arm64 appstream arm64 0.16.1-2 [404 kB]
Get:5 http://deb.debian.org/debian bookworm/main arm64 libglib2.0-data all 2.74.6-2+deb12u3 [1,209 kB]
Get:6 http://deb.debian.org/debian bookworm/main arm64 libglib2.0-bin arm64 2.74.6-2+deb12u3 [106 kB]
Get:7 http://deb.debian.org/debian bookworm/main arm64 libgstreamer1.0-0 arm64 1.22.0-2 [1,067 kB]
Get:8 http://deb.debian.org/debian bookworm/main arm64 libopenjp2-7 arm64 2.5.0-2 [175 kB]
Get:9 http://deb.debian.org/debian bookworm/main arm64 libpackagekit-glib2-18 arm64 1.2.6-5 [102 kB]
Get:10 http://deb.debian.org/debian bookworm/main arm64 libsodium23 arm64 1.0.18-1 [119 kB]
Get:11 http://deb.debian.org/debian bookworm/main arm64 libsodium-dev arm64 1.0.18-1 [137 kB]
Get:12 http://deb.debian.org/debian bookworm/main arm64 packagekit arm64 1.2.6-5 [584 kB]
Get:13 http://deb.debian.org/debian bookworm/main arm64 packagekit-tools arm64 1.2.6-5 [29.2 kB]
Fetched 4,282 kB in 1s (3,271 kB/s)
Selecting previously unselected package libstemmer0d:arm64.
(Reading database ... 65788 files and directories currently installed.)
Preparing to unpack .../00-libstemmer0d_2.2.0-2_arm64.deb ...
Unpacking libstemmer0d:arm64 (2.2.0-2) ...
Selecting previously unselected package libxmlb2:arm64.
Preparing to unpack .../01-libxmlb2_0.3.10-2_arm64.deb ...
Unpacking libxmlb2:arm64 (0.3.10-2) ...
Selecting previously unselected package libappstream4:arm64.
Preparing to unpack .../02-libappstream4_0.16.1-2_arm64.deb ...
Unpacking libappstream4:arm64 (0.16.1-2) ...
Selecting previously unselected package appstream.
Preparing to unpack .../03-appstream_0.16.1-2_arm64.deb ...
Unpacking appstream (0.16.1-2) ...
Selecting previously unselected package libglib2.0-data.
Preparing to unpack .../04-libglib2.0-data_2.74.6-2+deb12u3_all.deb ...
Unpacking libglib2.0-data (2.74.6-2+deb12u3) ...
Selecting previously unselected package libglib2.0-bin.
Preparing to unpack .../05-libglib2.0-bin_2.74.6-2+deb12u3_arm64.deb ...
Unpacking libglib2.0-bin (2.74.6-2+deb12u3) ...
Selecting previously unselected package libgstreamer1.0-0:arm64.
Preparing to unpack .../06-libgstreamer1.0-0_1.22.0-2_arm64.deb ...
Unpacking libgstreamer1.0-0:arm64 (1.22.0-2) ...
Selecting previously unselected package libopenjp2-7:arm64.
Preparing to unpack .../07-libopenjp2-7_2.5.0-2_arm64.deb ...
Unpacking libopenjp2-7:arm64 (2.5.0-2) ...
Selecting previously unselected package libpackagekit-glib2-18:arm64.
Preparing to unpack .../08-libpackagekit-glib2-18_1.2.6-5_arm64.deb ...
Unpacking libpackagekit-glib2-18:arm64 (1.2.6-5) ...
Selecting previously unselected package libsodium23:arm64.
Preparing to unpack .../09-libsodium23_1.0.18-1_arm64.deb ...
Unpacking libsodium23:arm64 (1.0.18-1) ...
Selecting previously unselected package libsodium-dev:arm64.
Preparing to unpack .../10-libsodium-dev_1.0.18-1_arm64.deb ...
Unpacking libsodium-dev:arm64 (1.0.18-1) ...
Selecting previously unselected package packagekit.
Preparing to unpack .../11-packagekit_1.2.6-5_arm64.deb ...
Unpacking packagekit (1.2.6-5) ...
Selecting previously unselected package packagekit-tools.
Preparing to unpack .../12-packagekit-tools_1.2.6-5_arm64.deb ...
Unpacking packagekit-tools (1.2.6-5) ...
Setting up libsodium23:arm64 (1.0.18-1) ...
Setting up libxmlb2:arm64 (0.3.10-2) ...
Setting up libpackagekit-glib2-18:arm64 (1.2.6-5) ...
Setting up libglib2.0-data (2.74.6-2+deb12u3) ...
Setting up libsodium-dev:arm64 (1.0.18-1) ...
Setting up libopenjp2-7:arm64 (2.5.0-2) ...
Setting up libstemmer0d:arm64 (2.2.0-2) ...
Setting up libgstreamer1.0-0:arm64 (1.22.0-2) ...
Setcap worked! gst-ptp-helper is not suid!
Setting up libglib2.0-bin (2.74.6-2+deb12u3) ...
Setting up libappstream4:arm64 (0.16.1-2) ...
Setting up appstream (0.16.1-2) ...
✔ Metadata cache was updated successfully.
Setting up packagekit (1.2.6-5) ...
Created symlink /etc/systemd/user/sockets.target.wants/pk-debconf-helper.socket → /usr/lib/systemd/user/pk-debconf-helper.socket.
Setting up packagekit-tools (1.2.6-5) ...
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for dbus (1.14.10-1~deb12u1) ...
Processing triggers for libc-bin (2.36-9+rpt2+deb12u7) ...


###### Installing python virtual environment...


###### Installing Moonraker python dependencies...
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Looking in links: /home/biqu/moonraker/scripts/python_wheels
Ignoring tornado: markers 'python_version == "3.7"' don't match your environment
Ignoring pillow: markers 'python_version == "3.7"' don't match your environment
Ignoring streaming-form-data: markers 'python_version == "3.7"' don't match your environment
Ignoring importlib_metadata: markers 'python_version == "3.7"' don't match your environment
Requirement already satisfied: tornado==6.4.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 4)) (6.4.1)
Requirement already satisfied: pyserial==3.4 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 5)) (3.4)
Requirement already satisfied: pyserial-asyncio==0.6 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 6)) (0.6)
Requirement already satisfied: pillow==10.3.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 8)) (10.3.0)
Requirement already satisfied: streaming-form-data==1.15.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 10)) (1.15.0)
Requirement already satisfied: distro==1.9.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 11)) (1.9.0)
Requirement already satisfied: inotify-simple==1.3.5 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 12)) (1.3.5)
Requirement already satisfied: libnacl==2.1.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 13)) (2.1.0)
Requirement already satisfied: paho-mqtt==1.6.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 14)) (1.6.1)
Requirement already satisfied: zeroconf==0.131.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 15)) (0.131.0)
Requirement already satisfied: preprocess-cancellation==0.2.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 16)) (0.2.1)
Requirement already satisfied: jinja2==3.1.4 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 17)) (3.1.4)
Requirement already satisfied: dbus-next==0.2.3 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 18)) (0.2.3)
Requirement already satisfied: apprise==1.8.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (1.8.0)
Requirement already satisfied: ldap3==2.9.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 20)) (2.9.1)
Requirement already satisfied: python-periphery==2.4.1 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 21)) (2.4.1)
Requirement already satisfied: importlib_metadata==8.2.0 in ./moonraker-env/lib/python3.11/site-packages (from -r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 23)) (8.2.0)
Requirement already satisfied: smart-open>=6.0 in ./moonraker-env/lib/python3.11/site-packages (from streaming-form-data==1.15.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 10)) (7.0.4)
Requirement already satisfied: ifaddr>=0.1.7 in ./moonraker-env/lib/python3.11/site-packages (from zeroconf==0.131.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 15)) (0.2.0)
Requirement already satisfied: MarkupSafe>=2.0 in ./moonraker-env/lib/python3.11/site-packages (from jinja2==3.1.4->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 17)) (2.1.5)
Requirement already satisfied: certifi in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2024.7.4)
Requirement already satisfied: requests in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2.32.3)
Requirement already satisfied: requests-oauthlib in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2.0.0)
Requirement already satisfied: click>=5.0 in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (8.1.7)
Requirement already satisfied: markdown in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.6)
Requirement already satisfied: PyYAML in ./moonraker-env/lib/python3.11/site-packages (from apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (6.0.1)
Requirement already satisfied: pyasn1>=0.4.6 in ./moonraker-env/lib/python3.11/site-packages (from ldap3==2.9.1->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 20)) (0.6.0)
Requirement already satisfied: zipp>=0.5 in ./moonraker-env/lib/python3.11/site-packages (from importlib_metadata==8.2.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 23)) (3.19.2)
Requirement already satisfied: wrapt in ./moonraker-env/lib/python3.11/site-packages (from smart-open>=6.0->streaming-form-data==1.15.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 10)) (1.16.0)
Requirement already satisfied: charset-normalizer<4,>=2 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.3.2)
Requirement already satisfied: idna<4,>=2.5 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.7)
Requirement already satisfied: urllib3<3,>=1.21.1 in ./moonraker-env/lib/python3.11/site-packages (from requests->apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (2.2.2)
Requirement already satisfied: oauthlib>=3.0.0 in ./moonraker-env/lib/python3.11/site-packages (from requests-oauthlib->apprise==1.8.0->-r /home/biqu/moonraker/scripts/moonraker-requirements.txt (line 19)) (3.2.2)


###### Initializing Moonraker Data Path at /home/biqu/printer_data
PolKit rules file found at /usr/share/polkit-1/rules.d/moonraker.rules


###### Launching Moonraker API Server...
biqu@serial-test:~ $

Now, when I check the web page, I get what I expect:

What do you think happened here?

Thanx!

There was a recent update of Moonraker that touched the installation procedure. Maybe KIAUH needs some adaption to handle this update correctly.

Ping @th33xitus

Sineos is correct. When adding support for installing Moonraker as a python package via pip I broke KIAUH’s dependency detection. I didn’t realize it was relying on the install script. Th33xitus has since pushed a fix.

I’m still having weirdness with the install (doing yet another right now). Any idea when the push will come through?


What I thought would be a simple action (erasing the Flash and then loading in Klipper/Katapult) for:

Has turned into two days of work with no end in sight.

I was able to get the ST-Link V2 working with relatively few problems - if anybody cares, the Linux version doesn’t seem to work with Ubuntu 24.04 LTS but it works fine under Windows 10.

So, I have a process where I can erase everything in the (STM32G0B1) MCU, load it from the Raspberry Pi zero 2W - now I just need to get Klipper working again.

As far as I know, the fix to KIAUH has already been pushed.

Good to know - I’ll take it out of my imaging process.

Could you take a look at:

Thanx!

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