Bug 488219 - Fails to update due to PK enum changes (in git main)
Summary: Fails to update due to PK enum changes (in git main)
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: PackageKit (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR grave
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://github.com/PackageKit/Package...
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-08 17:18 UTC by Sid
Modified: 2024-06-18 22:55 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sid 2024-06-08 17:18:46 UTC
While testing https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/2054, just wanted to double check if other PK clients pass. 

This was from Ubuntu 23.10 (all updates installed) to 24.04.

- GNOME packagekit starts the update without any issues.
- Plasma discover fails when `Update All` button is clicked in the UI as below.

### Error log:

[discover.update.error.txt](https://github.com/user-attachments/files/15744089/discover.update.error.txt)

### Screenshots (with enum change):

![plasma-discover-pk-error-1](https://github.com/PackageKit/PackageKit/assets/128038884/802f22cd-154e-4aa6-86d5-9d72769a79ac)
![plasma-discover-pk-error-2](https://github.com/PackageKit/PackageKit/assets/128038884/72dd5e4e-c662-40fc-9ae3-2de31b71814c)


### Screenshots (without enum change):

Proceeds with update.

![plasma-discover-pk-success](https://github.com/PackageKit/PackageKit/assets/128038884/9a92f1c4-a7ff-4c8e-97f7-f4804256ee21)
Comment 1 Sid 2024-06-08 17:20:36 UTC
The below patch would be handy to reproduce this issue as KDE Discover tries to download changelog of 2K+ packages which takes a huge amount of time.

--- a/backends/apt/apt-job.cpp
+++ b/backends/apt/apt-job.cpp
@@ -894,13 +894,7 @@ void AptJob::stageUpdateDetail(GPtrArray *updateArray, const pkgCache::VerIterat
 
         // fetch the changelog
         pk_backend_job_set_status(m_job, PK_STATUS_ENUM_DOWNLOAD_CHANGELOG);
-        changelog = fetchChangelogData(*m_cache,
-                                       fetcher,
-                                       candver,
-                                       currver,
-                                       &update_text,
-                                       &updated,
-                                       &issued);
+        changelog = "";
     }
 
     // Check if the update was updates since it was issued
Comment 2 Nate Graham 2024-06-10 19:12:58 UTC
Thanks for the heads-up! What version of PackageKit is this change scheduled to land in?
Comment 3 Sid 2024-06-11 05:57:55 UTC
> Thanks for the heads-up! What version of PackageKit is this change scheduled to land in?

the next release - v1.3.0 - to be released shortly (in a month)
Comment 4 Matthias Klumpp 2024-06-13 23:11:35 UTC
@Sid, can you check if https://invent.kde.org/plasma/discover/-/merge_requests/865 fixes the issue? You will need the very latest Git master version of PackageKitQt to test the patch from that MR, as that version introduces the QPK_CHECK_VERSION macro  that the MR relies on.
Comment 5 Sid 2024-06-14 09:30:38 UTC
> @Sid, can you check if https://invent.kde.org/plasma/discover/-/merge_requests/865 fixes the issue?

I've never used KDE nor built KDE apps from git. It's going to take a lot of time (which I'm afraid I don't have). I think it would be great, if one of the KDE Discover app devs can test this fix. 

Steps to test the fix:

- Install a recent enough Ubuntu version in a VM (say, 23.10 minimal install)
- Install all updates of 23.10
- Run 'do-release-upgrade' command to trigger upgrade to 24.04. This should update /etc/apt/sources.list with 24.04 repo details.
- Try upgrading in KDE Discover.
- Upgrade should fail (without this patch) and pass (with patch).

A simpler way would be to get a system which has new-pkg installs and pkg removals as part of the update. I did the above distro upgrade, as I didn't have such a system state.
Comment 6 Matthias Klumpp 2024-06-18 22:50:41 UTC
Git commit 83df60b726d5e6586509885d7927e6e0803e8322 by Matthias Klumpp.
Committed on 18/06/2024 at 19:25.
Pushed by apol into branch 'master'.

packagekit: Add support for new action info enum values

M  +14   -0    libdiscover/backends/PackageKitBackend/PackageKitMessages.cpp
M  +10   -0    libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp

https://invent.kde.org/plasma/discover/-/commit/83df60b726d5e6586509885d7927e6e0803e8322
Comment 7 Aleix Pol 2024-06-18 22:55:01 UTC
Git commit 8204a2fd9d0f1b848155bd91670933cb6994c0ae by Aleix Pol Gonzalez.
Committed on 18/06/2024 at 22:51.
Pushed by apol into branch 'Plasma/6.1'.

packagekit: Add support for new action info enum values


(cherry picked from commit 83df60b726d5e6586509885d7927e6e0803e8322)

Co-authored-by: Matthias Klumpp <matthias@tenstral.net>

M  +14   -0    libdiscover/backends/PackageKitBackend/PackageKitMessages.cpp
M  +10   -0    libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp

https://invent.kde.org/plasma/discover/-/commit/8204a2fd9d0f1b848155bd91670933cb6994c0ae