moonraker icon indicating copy to clipboard operation
moonraker copied to clipboard

Cannot shutdown or reboot host

Open xiaojie0815 opened this issue 1 year ago • 4 comments

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 QQ截图20240111223118

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

xiaojie0815 avatar Jan 11 '24 14:01 xiaojie0815

system message 11

xiaojie0815 avatar Jan 11 '24 14:01 xiaojie0815

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.

Arksine avatar Jan 11 '24 20:01 Arksine

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

xiaojie0815 avatar Jan 12 '24 12:01 xiaojie0815

@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

  1. sudo apt install x11-utils
  2. 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.

xiaojie0815 avatar Jan 13 '24 16:01 xiaojie0815

As this discussion seems to have concluded I'm going to close this. It appears the cause is distro related.

Arksine avatar May 08 '24 09:05 Arksine