Bug 467638 - discover doesn't recognize a fixed broken package problem
Summary: discover doesn't recognize a fixed broken package problem
Status: RESOLVED FIXED
Alias: None
Product: Discover
Classification: Applications
Component: discover (other bugs)
Version First Reported In: 5.27.3
Platform: Neon Linux
: NOR minor
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-21 06:10 UTC by Martin Tlustos
Modified: 2023-04-11 20:56 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In: 5.27.4
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Tlustos 2023-03-21 06:10:08 UTC
SUMMARY
This is a more complicated problem, but it boils down to this: I did an update with sudo pkcon update that I had to cancel. It then complained that some package was broken, so I did sudo dpkg --configure -a to fix it. Everything went fine, all updates are installed etc. But now every restart, discover/plasma complains about a broken package and that I have to do dpkg --configure -a to fix it (which I already did). So it's more of an annoyance rather than a bug, but I still think it needs fixing... ;-)

***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. do an update with pkcon and cancel it
2. repair the broken package problem with dpkg --configure -a
3. restart

OBSERVED RESULT
plasma/discover complains every start

EXPECTED RESULT
it shouldn't
Operating System: KDE neon 5.27
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Kernel Version: 5.19.0-35-generic (64-bit)
Graphics Platform: X11
Processors: 6 × AMD Ryzen 5 4500U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Acer
Product Name: Aspire A515-44G
System Version: V1.12

ADDITIONAL INFORMATION
Comment 1 Martin Tlustos 2023-03-22 09:22:21 UTC
Additional info: I had disabled offline updates. After re-enabling them, applying the next available updates and restarting, the error message did not show up again. So it seems like there was some error log left behind that only gets cleared in offline mode, but when you switch to the old way of doing updates, it will keep on popping up.
Comment 2 Martin Tlustos 2023-03-22 09:23:28 UTC
It works for me now, but I don't mark it as fixed so someone can have a look at whether this behavior should be improved.
Comment 3 Aleix Pol 2023-03-30 23:18:02 UTC
It would have needed to remove the "/var/lib/PackageKit/offline-update-competed" file.

This is something that should be done by PackageKit so at least it's a bug there upstream (on two counts: failing to cancel properly and then not clearing the state as requested).

Do you remember if you pressed "Repair System" or you closed the notification?
Comment 4 Bug Janitor Service 2023-03-30 23:25:07 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/518
Comment 5 Martin Tlustos 2023-03-31 05:21:39 UTC
(In reply to Aleix Pol from comment #3)
> It would have needed to remove the
> "/var/lib/PackageKit/offline-update-competed" file.
> 
> This is something that should be done by PackageKit so at least it's a bug
> there upstream (on two counts: failing to cancel properly and then not
> clearing the state as requested).
> 
> Do you remember if you pressed "Repair System" or you closed the
> notification?

Yes, I clicked both "repair system" and "open discover" and closed the notification after several startups.
Comment 6 Aleix Pol 2023-03-31 15:45:56 UTC
Git commit cbecc135d99b535a67f9a0d9a1b8b484e4c47e9a by Aleix Pol.
Committed on 31/03/2023 at 14:53.
Pushed by apol into branch 'master'.

pk: Clear the offline state before starting a new one

If there's results left-over from the past, just clear them and hope for
better luck next time.

M  +6    -0    libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp

https://invent.kde.org/plasma/discover/commit/cbecc135d99b535a67f9a0d9a1b8b484e4c47e9a
Comment 7 Aleix Pol 2023-03-31 15:49:28 UTC
Git commit 18a85033c4f79157693b45247c7a19a6a648ec32 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 31/03/2023 at 15:46.
Pushed by apol into branch 'Plasma/5.27'.

pk: Clear the offline state before starting a new one

If there's results left-over from the past, just clear them and hope for
better luck next time.


(cherry picked from commit cbecc135d99b535a67f9a0d9a1b8b484e4c47e9a)

M  +6    -0    libdiscover/backends/PackageKitBackend/PackageKitUpdater.cpp

https://invent.kde.org/plasma/discover/commit/18a85033c4f79157693b45247c7a19a6a648ec32
Comment 8 Nate Graham 2023-04-06 19:53:19 UTC
Can we also clear it after the user clicks the "repair" button in the notification? We have some bug reports about this not working.
Comment 9 Bug Janitor Service 2023-04-06 20:15:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/discover/-/merge_requests/527
Comment 10 Nate Graham 2023-04-11 20:55:31 UTC
Git commit e87a50f455619dea5c51dea9c290556739112fc7 by Nate Graham.
Committed on 11/04/2023 at 20:53.
Pushed by ngraham into branch 'master'.

Always clear offline updates file after a repair operation

No matter what the results of the repair operation were, there's nothing
of any value that anyone can do with the file anymore, and if it sticks
around, it can annoy the user on every subsequent login for no good
reason. So let's just remove it.
Related: bug 451753, bug 450973
FIXED-IN: 5.27.5

M  +7    -0    libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp

https://invent.kde.org/plasma/discover/commit/e87a50f455619dea5c51dea9c290556739112fc7
Comment 11 Nate Graham 2023-04-11 20:56:37 UTC
Git commit b18ebb137e49ccde3be49239bfaa8d88ace6a0c4 by Nate Graham.
Committed on 11/04/2023 at 20:56.
Pushed by ngraham into branch 'Plasma/5.27'.

Always clear offline updates file after a repair operation

No matter what the results of the repair operation were, there's nothing
of any value that anyone can do with the file anymore, and if it sticks
around, it can annoy the user on every subsequent login for no good
reason. So let's just remove it.
Related: bug 451753, bug 450973
FIXED-IN: 5.27.5


(cherry picked from commit e87a50f455619dea5c51dea9c290556739112fc7)

M  +7    -0    libdiscover/backends/PackageKitBackend/PackageKitNotifier.cpp

https://invent.kde.org/plasma/discover/commit/b18ebb137e49ccde3be49239bfaa8d88ace6a0c4