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
miklschmidt
miklschmidt•16mo ago
Your moonraker.log just stops abruptly. There's no telling what went wrong, there are no fatal errors. Did you try rebooting your pi?
stormy-gold
stormy-gold•16mo 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?
miklschmidt
miklschmidt•16mo ago
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
ssh pi@ratos.local
df -h
ssh pi@ratos.local
df -h
paste the results here. then run
sudo systemctl status moonraker
sudo systemctl status moonraker
Paste the results here. (run these commands in the windows command prompt)
stormy-gold
stormy-gold•16mo 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
miklschmidt
miklschmidt•16mo ago
Plenty of space, so it's not that
stormy-gold
stormy-gold•16mo ago
miklschmidt
miklschmidt•16mo ago
hmm.. moonraker isn't starting Run
cat /etc/systemd/system/moonraker.service
cat /etc/systemd/system/moonraker.service
paste the results
stormy-gold
stormy-gold•16mo 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
miklschmidt
miklschmidt•16mo ago
Wait what version of ratos are you running? /home/pi/printer_data/systemd/moonraker.env would indicate RatOS v2.0
stormy-gold
stormy-gold•16mo ago
1.2.4-1
miklschmidt
miklschmidt•16mo ago
Hmm! run
cat /home/pi/printer_data/systemd/moonraker.env
cat /home/pi/printer_data/systemd/moonraker.env
paste the results
stormy-gold
stormy-gold•16mo 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:~ $
miklschmidt
miklschmidt•16mo ago
run
sudo systemctl stop moonraker
sudo systemctl stop moonraker
and then
/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
/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
paste the results of the last command
stormy-gold
stormy-gold•16mo 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'
miklschmidt
miklschmidt•16mo 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
/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
is supposed to be one line You ran it as two commands, run it as one
stormy-gold
stormy-gold•16mo 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?
miklschmidt
miklschmidt•16mo ago
Yes, error is strange though do
ls -la /home/pi/printer_data
ls -la /home/pi/printer_data
paste the results
stormy-gold
stormy-gold•16mo 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
miklschmidt
miklschmidt•16mo ago
Somehow it seems that moonraker didn't get properly updated
cd ~/moonraker/
git status
cd ~/moonraker/
git status
paste the results
stormy-gold
stormy-gold•16mo 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
miklschmidt
miklschmidt•16mo ago
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
cat ~/klipper_config/printer.cfg
cat ~/klipper_config/printer.cfg
stormy-gold
stormy-gold•16mo ago
I have access via filezilla. So I can copy everything
miklschmidt
miklschmidt•16mo ago
seems like you installed a few moonraker extensions and modified your moonraker config, get that via:
cat ~/klipper_config/moonraker.conf
cat ~/klipper_config/moonraker.conf
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)
stormy-gold
stormy-gold•16mo ago
is there a way to test if it is possible to reinstall Moonraker via ssh command to test if it works after all?
miklschmidt
miklschmidt•16mo ago
You can try that, but it's only a matter of time before something else gets corrupted and cause erratic behavior just a sec
rm -rf ~/moonraker ~/moonraker-env
cd ~/
git clone https://github.com/Arksine/moonraker.git
cd ~/moonraker/scripts
./install-moonraker.sh
rm -rf ~/moonraker ~/moonraker-env
cd ~/
git clone https://github.com/Arksine/moonraker.git
cd ~/moonraker/scripts
./install-moonraker.sh
stormy-gold
stormy-gold•16mo ago
It works!!! (Temporary) Thanks for your super help!!!
miklschmidt
miklschmidt•16mo ago
You're welcome 🙂