moonraker
moonraker copied to clipboard
Cannot shutdown or reboot host
What happened
What happened?
When trying to shutdown or reboot the host system for the GUI, it shows the following error in the log and just ignores the command:
2024-01-11 21:24:10,561 [common.py:build_error()] - JSON-RPC Request Error - Requested Method: machine.reboot, Code: -31000, Message: Interactive authentication required.
KlipperScreen.log As shown below
I tried the following commands but none of them work the first method: cd ~/moonraker/scripts ./set-policykit-rules.sh sudo service moonraker restart The second method: cd ~/moonraker/scripts ./install-moonraker.sh
Client
Fluidd, KlipperScreen
Browser
Chrome
How to reproduce
Go to system -> shutdown -> host system
No error, and host shutdown.
Additional information
No response
system message
It looks like you are trying to run Moonraker on a smartphone. While this may work for general purpose usage, the distribution could be missing packages Moonraker depends on such as dbus
and policykit
for its extended functionality. Alternatively it may not use systemd
as the init manager, in which case Moonraker will be unable to perform actions such as shutdown
and reboot
. If its running systemd but missing the aforementioned packages you could try to configure the provider option in [machine]
to systemd_cli
.
You could attach moonraker.log
for me to get a more detailed look at the system and I'll see if I can provide further guidance, but I suspect the answer is that Moonraker will be unable to perform a shutdown in your environment.
It looks like you are trying to run Moonraker on a smartphone. While this may work for general purpose usage, the distribution could be missing packages Moonraker depends on such as dbus and policykit for its extended functionality. Alternatively it may not use systemd as the init manager, in which case Moonraker will be unable to perform actions such as shutdown and reboot. If its running systemd but missing the aforementioned packages you could try to configure the provider option in [machine] to systemd_cli.
You could attach moonraker.log for me to get a more detailed look at the system and I'll see if I can provide further guidance, but I suspect the answer is that Moonraker will be unable to perform a shutdown in your environment.
moonraker.log This is the log file I generated. Please take a look. Thank you very much for your help. @Arksine
@Arksine
I compared the software packages that can be installed on the Debian system.
I uninstalled the following packages 1.dbus-bin 2.dbus-daemon 3. dbus-session-bus-common 4. dbus-system-bus-common
Then install these two packages
- sudo apt install x11-utils
- sudo apt install xdg-utils
After uninstalling and reinstalling Moonraker, the shutdown and restart commands now work normally. I don't know the specific reason yet.
As this discussion seems to have concluded I'm going to close this. It appears the cause is distro related.