SUMMARY This is a longstanding bug. I updated Event Calendar by removing it and re-installing it a couple of times, but Discover is still unable to update it. STEPS TO REPRODUCE 1. Install an older version of Event Calendar (I have v65 currently) 2. Open Discover 3. Click on "Plasma Addons" (or else search won't find anything) 4. Search for "Event Calendar" (often, search gets stuck... different bug) 5. Click on the result OBSERVED RESULT The version currently installed is displayed (v65 in my case). If you click on the "Visit the app's website" link, you'll be taken to https://store.kde.org/p/998901 , which has v68. EXPECTED RESULT Discover should automatically update Event Calendar to v68 SOFTWARE/OS VERSIONS KDE Plasma Version: 5.19.80 KDE Frameworks Version: 5.73.0 Qt Version: 5.15.0 ADDITIONAL INFORMATION Everything is built from git head, but the bug also exists in 5.19.3.
This might be the root cause: bernie@goreboot:~/.local/share/plasma/plasmoids% kpackagetool5 -l kf.package: No metadata file in the package, expected it at: "/home/bernie/.local/share/plasma/plasmoids/" kf.package: No metadata file in the package, expected it at: "/home/bernie/.local/share/plasma/plasmoids/" Listing service types: KPackage/Generic in /home/bernie/.local/share/kpackage/generic/ bernie@goreboot:~/.local/share/plasma/plasmoids% ls -la kpluginindex.json .rw-r--r-- bernie users 2.1 KB Mon Jul 20 00:04:17 2020 kpluginindex.json bernie@goreboot:~/.local/share/plasma/plasmoids% file kpluginindex.json kpluginindex.json: bzip2 compressed data, block size = 500k
On my system, there's a f kpackagetool5 -t Plasma/Applet --remove-index kpackagetool5 -t Plasma/Applet --generate-index Finally, Event Calendar v68 can be found! So this is some form of index corruption. It has happened multiple times, on two different machines (one with Fedora and one with Arch Linux). The only thing they have in common is using XFS for the root and home partitions.
Created attachment 130256 [details] Corrupt index file
After regenerating the index file, I opened plasma-discover again and launched the pending Event Calendar update. Unfortunately, it didn't succeed. I saw an error bubble at the bottom of the Discover window that disappeared before I could take a note (it did not let me select the text). The error looked something like: "plasmoid installation failed with return code 4..." After this, Discovered remained stuck at 50% of the update, with the task "View Updates - Installing" still pending, and "Event Calendar - Installing" not yet started. Clicking the "Cancel" button in the top-right of the window didn't do anything. I tried to quit, and got a message "Could not close Discover, there are tasks that need to be done." I clicked "Quit anyway", and it worked (I checked, no dangling processes).
After reopening Discover, Event Calendar can't be updated any more. So it seems we have... Discovered who corrupted kpluginindex.json! 😏
Created attachment 130257 [details] Screenshot of Discover displaying the installation error
The attached screenshot shows this error message: plasmoids.knsrc: An error occurred during the installation process: The installation failed with code 4 while attempting to run the command: kpackagetool5 --install "/tmp/eventcalendar-v68-plasma5.12.plasmoid" --type Plasma/Applet
Ok, so this is why it fails: bernie@goreboot:~/kde/src% kpackagetool5 --install "/tmp/eventcalendar-v68-plasma5.12.plasmoid" --type Plasma/Applet Error: Installation of /tmp/eventcalendar-v68-plasma5.12.plasmoid failed: /home/bernie/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar already exists I'd argue that either kpackagetool5 or Discover should try harder to recover from this condition. The error message could include the stdout/stderr output, and allow copy-pasting the command. As things stand now, users would be stuck with a system that can no longer be updated.
SOLVED: rm -rf ~/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar After this, Discover is able to install Event Calendar.
Dan and Alexander, any ideas here?
Is this issue in any way affected by https://invent.kde.org/frameworks/knewstuff/-/commit/3f38da8a70d8101d8fda586c28c4c8cd64d68daa? I know you said it was long standing, but by bringing the kpackage support to KNS we are doing some things differently. With the old variant we failed to update, because KNS tried to install it when updating. Then kpackage was complaining about the entry being already installed. @Dan, why do we now always use the update operation when installing a kpackage? And the KNSCore::KPackageJob::install method isn't used anywhere. Shouldn't we differentiate between update and install operations?
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/236
Git commit ce920603ea93ae4abf391d477001bb67cd429ed1 by Alexander Lohnau. Committed on 01/09/2020 at 08:09. Pushed by alex into branch 'master'. Fix undetected KPackage installation This was the last occurrence that didn't get ported/detected. Because of that the updating did not work and uninstalling an entry using the "Widget Explorer" did not work. Related: bug 423055 FIXED-IN: 5.20 M +2 -2 components/shellprivate/widgetexplorer/plasmoids.knsrc https://invent.kde.org/plasma/plasma-workspace/commit/ce920603ea93ae4abf391d477001bb67cd429ed1
*** Bug 417933 has been marked as a duplicate of this bug. ***
*** Bug 355011 has been marked as a duplicate of this bug. ***