Bug 442383 - Discover is unable to remove apps from distro repos: "You have no authorization to execute this operation"
Summary: Discover is unable to remove apps from distro repos: "You have no authorizati...
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (show other bugs)
Version: 5.22.5
Platform: Archlinux Linux
: NOR normal
Target Milestone: ---
Assignee: Dan Leinir Turthra Jensen
URL:
Keywords:
: 443001 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-09-13 13:57 UTC by Patrick Silva
Modified: 2021-09-27 18:51 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.23


Attachments
screenshot (133.14 KB, image/png)
2021-09-13 13:57 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2021-09-13 13:57:24 UTC
Created attachment 141515 [details]
screenshot

SUMMARY
Discover does not remove apps from distro repos and says
"You have no authorization to execute this operation".
See the attached screenshot please.

EXPECTED RESULT
remove apps from any source

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Graphics Platform: Wayland
Comment 1 Nate Graham 2021-09-16 17:15:28 UTC
Works for me in Fedora. Is it broken for you in Neon too?
Comment 2 Patrick Silva 2021-09-16 19:36:53 UTC
No. Discover remove apps from neon unstable repos as expected.
Comment 3 Nate Graham 2021-09-16 19:58:25 UTC
Then it seems like a bug in Arch's PackageKit configuration, PackageKit plugin, or PolKit configuration. Can you follow up with them?
Comment 4 Antonio Rojas 2021-09-17 07:07:18 UTC
I don't think this is a packagekit problem. pkcon remove and gnome-software both show the polkit prompt as expected. This only happens in discover.
Comment 5 Nate Graham 2021-09-17 14:46:41 UTC
OK, thanks.
Comment 6 Matt Chapman 2021-09-20 09:19:43 UTC
I am experiencing the same issue on Fedora 34.

Operating System: Fedora 34
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2
Kernel Version: 5.13.16-200.fc34.x86_64 (64-bit)

Journal reports the following:

```
Sep 20 10:15:38 SHODANv4 packagekitd[4950]: WARNING: Repomd xml parser: Unknown element "revision"
Sep 20 10:15:38 SHODANv4 packagekitd[4950]: WARNING: Repomd xml parser: Unknown element "revision"
Sep 20 10:15:38 SHODANv4 packagekitd[4950]: WARNING: Repomd xml parser: Unknown element "revision"
Sep 20 10:15:38 SHODANv4 PackageKit[4950]: resolve transaction /1974_addaaaaa from uid 1000 finished with success after 1092ms
Sep 20 10:15:38 SHODANv4 PackageKit[4950]: resolve transaction /1975_dcdccbab from uid 1000 finished with success after 2ms
Sep 20 10:15:39 SHODANv4 plasma-discover[17284]: qrc:/qml/ApplicationsListPage.qml:16:1: QML ApplicationsListPage: Binding loop detected for property "implicitHeight"
Sep 20 10:15:40 SHODANv4 PackageKit[4950]: resolve transaction /1976_ceaeeeec from uid 1000 finished with success after 15ms
Sep 20 10:15:40 SHODANv4 PackageKit[4950]: resolve transaction /1977_baccdade from uid 1000 finished with success after 12ms
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 PackageKit[4950]: new remove-packages transaction /1978_eedccbdb scheduled from uid 1000
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 PackageKit[4950]: in /1978_eedccbdb for remove-packages package gnome-disk-utility;40.2-1.fc34;x86_64;installed:updates was removing for uid 1000
Sep 20 10:15:41 SHODANv4 PackageKit[4950]: remove-packages transaction /1978_eedccbdb from uid 1000 finished with success after 223ms
Sep 20 10:15:41 SHODANv4 PackageKit[4950]: uid 1000 is trying to obtain org.freedesktop.packagekit.package-remove auth (only_trusted:1)
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: percentage cannot be calculated
Sep 20 10:15:41 SHODANv4 PackageKit[4950]: uid 1000 failed to obtain auth
Sep 20 10:15:41 SHODANv4 plasma-discover[17284]: PackageKit error: PackageKit::Transaction::ErrorNotAuthorized "You have no authorisation to execute this operation" "Failed to obtain authentication."

Removing the package via `dnf` or `pkcon remove` works as expected, which suggests to me that polkit and packagekit are correctly functioning.

Please let me know if there is any more information I can provide.
Comment 7 Antonio Rojas 2021-09-25 09:58:44 UTC
Git commit 56013c2afffd369cc59c8f616fa6d8328413a189 by Antonio Rojas.
Committed on 25/09/2021 at 09:56.
Pushed by arojas into branch 'bug-442383'.

Explicitly set the interactive flag for PackageKit transactions

Since PackageKit commit 86f4a2fbf5fcb1230c68a57c4a7bc066aa3f7ef4 the polkit authentication dialog is only shown if the transaction is flagged as interactive

M  +2    -1    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://invent.kde.org/plasma/discover/commit/56013c2afffd369cc59c8f616fa6d8328413a189
Comment 8 Antonio Rojas 2021-09-25 10:27:12 UTC
Ugh that was just a pull request, not merged yet
Comment 9 Aleix Pol 2021-09-26 23:25:44 UTC
Git commit c829aa67fa0b218ee282c52dfe6fb3a680889f77 by Aleix Pol Gonzalez, on behalf of Antonio Rojas.
Committed on 26/09/2021 at 23:25.
Pushed by apol into branch 'Plasma/5.23'.

Explicitly set the interactive flag for PackageKit transactions

Since PackageKit commit 86f4a2fbf5fcb1230c68a57c4a7bc066aa3f7ef4 the polkit authentication dialog is only shown if the transaction is flagged as interactive


(cherry picked from commit 56013c2afffd369cc59c8f616fa6d8328413a189)

M  +2    -1    libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp

https://invent.kde.org/plasma/discover/commit/c829aa67fa0b218ee282c52dfe6fb3a680889f77
Comment 10 Antonio Rojas 2021-09-27 08:05:49 UTC
*** Bug 443001 has been marked as a duplicate of this bug. ***