Bug 2081039 - cockpit unable to cancel a scheduled reboot via dbus
Summary: cockpit unable to cancel a scheduled reboot via dbus
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: cockpit
Version: 37
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Martin Pitt
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-02 15:26 UTC by Jelle van der Waa
Modified: 2023-01-13 12:27 UTC (History)
17 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-13 12:27:59 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jelle van der Waa 2022-05-02 15:26:10 UTC
Description of problem:

Cockpit is unable to cancel a scheduled reboot via DBus with the following error:

Failed to cancel shutdown Interactive authentication required

Cockpit calls the following dbus command, but via it cockpit itself.

busctl call org.freedesktop.login1 /org/freedesktop/login1  org.freedesktop.login1.Manager CancelScheduledShutdown

Version-Release number of selected component (if applicable):

The last known good version is v250.3-6.fc37, the first v251 version breaks. 

How reproducible:

Always

Steps to Reproduce:
1. Schedule a reboot in cockpit as administrator (with adminstrative access). (Click reboot => shows a dialog schedule for X minutes)
2. Notice that the "Health card" has a cancel shutdown button
3. Click the cancel shutdown button

Actual results:

Failed to cancel shutdown Interactive authentication required

Expected results:

No error, reboot cancelled.

Additional info:

Monitoring with:

busctl monitor org.freedesktop.login1.Manager

Shows the following:

‣ Type=method_return  Endian=l  Flags=1  Version=1 Cookie=-1  ReplyCookie=2009  Timestamp="Mon 2022-05-02 13:37:13.555384 UTC"
  Sender=org.freedesktop.DBus  Destination=:1.46
  MESSAGE "u" {
          UINT32 1782;
  };

‣ Type=method_return  Endian=l  Flags=1  Version=1 Cookie=2010  ReplyCookie=360  Timestamp="Mon 2022-05-02 13:37:13.556330 UTC"
  Sender=:1.46  Destination=:1.4
  UniqueName=:1.46
  MESSAGE "(bba{ss})" {
          STRUCT "bba{ss}" {
                  BOOLEAN false;
                  BOOLEAN true;
                  ARRAY "{ss}" {
                          DICT_ENTRY "ss" {
                                  STRING "polkit.retains_authorization_after_challenge";
                                  STRING "1";
                          };
                  };
          };
  };

‣ Type=error  Endian=l  Flags=1  Version=1 Cookie=361  ReplyCookie=1339  Timestamp="Mon 2022-05-02 13:37:13.557643 UTC"
  Sender=:1.4  Destination=:1.41
  ErrorName=org.freedesktop.DBus.Error.InteractiveAuthorizationRequired  ErrorMessage="Interactive authentication required."
  UniqueName=:1.4
  MESSAGE "s" {
          STRING "Interactive authentication required.";
  };

Comment 1 Martin Pitt 2022-05-02 21:54:41 UTC
At first sight this is cockpit's bug. cancelShutdownAction() does not connect to the system bus as root, it's missing a { superuser: "try" }.

Comment 2 Martin Pitt 2022-05-02 22:04:19 UTC
Seems this was an intended, not an accidental change: https://github.com/systemd/systemd/commit/ec14fba91c94f38f3 (part of https://github.com/systemd/systemd/pull/21838)

Comment 3 Martin Pitt 2022-05-03 07:47:07 UTC
Fixing in https://github.com/cockpit-project/cockpit/pull/17302

Comment 4 Ben Cotton 2022-08-09 13:41:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 37 development cycle.
Changing version to 37.

Comment 5 Martin Pitt 2023-01-13 12:27:59 UTC
This was fixed long ago in Cockpit 269.


Note You need to log in before you can comment on or make changes to this bug.