Cannot connect to Moonraker (after Moonraker Update?)
Hello Together
Just wanted to start the printer today. But now I have an error: "Cannot connect to Moonraker".
Probably after the last update...
Is there a known solution here?
27 Replies
Your moonraker.log just stops abruptly. There's no telling what went wrong, there are no fatal errors. Did you try rebooting your pi?
absent-sapphire•2y ago
Thanks for your feedback.
I have restarted the printer several times and plugged and unplugged it.
I think I had run the updates two days ago. but then not used the printer since.
Could it be this update that is not working?
No, checked that, works fine
Might be SD card corruption.
Or you ran out of space or something
Hard to tell without more information.
ssh in to the pi
paste the results here.
then run
Paste the results here.
(run these commands in the windows command prompt)
absent-sapphire•2y ago
Filesystem Size Used Avail Use% Mounted on
/dev/root 15G 8.7G 5.1G 64% /
devtmpfs 1.7G 0 1.7G 0% /dev
tmpfs 1.9G 0 1.9G 0% /dev/shm
tmpfs 1.9G 8.8M 1.9G 1% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
/dev/mmcblk0p1 253M 50M 203M 20% /boot
tmpfs 379M 0 379M 0% /run/user/1000
Plenty of space, so it's not that
absent-sapphire•2y ago
hmm.. moonraker isn't starting
Run
paste the results
absent-sapphire•2y ago
systemd service file for moonraker
[Unit]
Description=API Server for Klipper SV1
Requires=network-online.target
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
User=pi
SupplementaryGroups=moonraker-admin
RemainAfterExit=yes
WorkingDirectory=/home/pi/moonraker
EnvironmentFile=/home/pi/printer_data/systemd/moonraker.env
ExecStart=/home/pi/moonraker-env/bin/python $MOONRAKER_ARGS
Restart=always
RestartSec=10
Wait what version of ratos are you running?
/home/pi/printer_data/systemd/moonraker.env
would indicate RatOS v2.0absent-sapphire•2y ago
1.2.4-1
Hmm!
run
paste the results
absent-sapphire•2y ago
pi@ratos:~ $ cat /home/pi/printer_data/systemd/moonraker.env
MOONRAKER_ARGS="/home/pi/moonraker/moonraker/moonraker.py -d /home/pi/printer_data -c /home/pi/klipper_config/moonraker.conf -l /home/pi/klipper_logs/moonraker.log"pi@ratos:~ $
run
and then
paste the results of the last command
absent-sapphire•2y ago
/home/pi/moonraker-env/bin/python
Python 3.7.3 (default, Oct 31 2022, 14:04:00)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
/home/pi/moonraker/moonraker/moonraker.py -d /home/pi/printer_data -c /home/pi/klipper_config/moonraker.conf -l File "<stdin>", line 1 /home/pi/moonraker/moonraker/moonraker.py -d /home/pi/printer_data -c /home/pi/klipper_config/moonraker.conf -l ^ SyntaxError: invalid syntax >>>pi@ratos:~ $ /home/pi/moonraker/moonraker/moonraker.py -d /home/pi/printer_data -c /home/pi/klipper_config/moonraker.conf -l /home/pi/klipper_logs/moonraker.log Traceback (most recent call last): File "/home/pi/moonraker/moonraker/moonraker.py", line 20, in <module> import confighelper File "/home/pi/moonraker/moonraker/confighelper.py", line 13, in <module> from components.template import JinjaTemplate File "/home/pi/moonraker/moonraker/components/template.py", line 8, in <module> import jinja2 ModuleNotFoundError: No module named 'jinja2'
is supposed to be one line
You ran it as two commands, run it as one
absent-sapphire•2y ago
/home/pi/moonraker-env/bin/python /home/pi/moonraker/moonraker/moonraker.py -d /home/pi/printer_data -c /home/pi/klipper_config/moonraker.conf -l /home/pi/klipper_logs/moonraker.log
usage: moonraker.py [-h] [-c <configfile>] [-l <logfile>] [-n]
moonraker.py: error: unrecognized arguments: -d /home/pi/printer_data
correkt?
Yes, error is strange though
do
paste the results
absent-sapphire•2y ago
total 28
drwxr-xr-x 6 pi pi 4096 Jan 2 13:43 .
drwxr-xr-x 26 pi pi 4096 Feb 19 12:17 ..
drwxr-xr-x 3 pi pi 4096 Oct 17 08:39 backup
drwxr-xr-x 2 pi pi 4096 Oct 17 08:39 certs
drwxr-xr-x 2 pi pi 4096 Feb 17 20:17 comms
lrwxrwxrwx 1 pi pi 23 Oct 17 08:39 config -> /home/pi/klipper_config
lrwxrwxrwx 1 pi pi 28 Oct 17 08:39 database -> /home/pi/.moonraker_database
lrwxrwxrwx 1 pi pi 20 Oct 17 08:39 gcodes -> /home/pi/gcode_files
lrwxrwxrwx 1 pi pi 21 Oct 17 08:39 logs -> /home/pi/klipper_logs
-rw-r--r-- 1 pi pi 81 Jan 2 13:43 moonraker.asvc
drwxr-xr-x 2 pi pi 4096 Oct 17 08:39 systemd
Somehow it seems that moonraker didn't get properly updated
paste the results
absent-sapphire•2y ago
On branch master
error: object file .git/objects/36/de982692c416ef3cc4d494784433e56d393dd0 is empty
error: object file .git/objects/36/de982692c416ef3cc4d494784433e56d393dd0 is empty
fatal: loose object 36de982692c416ef3cc4d494784433e56d393dd0 (stored in .git/objects/36/de982692c416ef3cc4d494784433e56d393dd0) is corrupt
Yep, SD card corruption
I'd get a new SD card and reinstall
(i know that sucks to hear)
you can get the contents of your current config files through ssh
for example run
absent-sapphire•2y ago
I have access via filezilla.
So I can copy everything
seems like you installed a few moonraker extensions and modified your moonraker config, get that via:
Ok great! that'll work fine 🙂
I recommend sandisk extreme for the sd card btw
(if you're going to buy a new one that is)
absent-sapphire•2y ago
is there a way to test if it is possible to reinstall Moonraker via ssh command to test if it works after all?
You can try that, but it's only a matter of time before something else gets corrupted and cause erratic behavior
just a sec
absent-sapphire•2y ago
It works!!! (Temporary)
Thanks for your super help!!!
You're welcome 🙂