Bug 402306 - PackageKit crashes every time while fetching updates for Discover
Summary: PackageKit crashes every time while fetching updates for Discover
Status: RESOLVED UPSTREAM
Alias: None
Product: Discover
Classification: Applications
Component: discover (show other bugs)
Version: 5.14.4
Platform: Kubuntu Linux
: NOR crash
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-18 14:50 UTC by leftcrane
Modified: 2018-12-25 13:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Gnome software example error (one of many) (29.98 KB, image/png)
2018-12-22 21:25 UTC, leftcrane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description leftcrane 2018-12-18 14:50:57 UTC
This is all I could find in the logs (I didn't kill it):

12/18/18 5:07 PM	packagekitd	terminate called after throwing an instance of 'std::length_error'
12/18/18 5:07 PM	packagekitd	  what():  basic_string::_M_replace
12/18/18 5:07 PM	systemd	packagekit.service: Main process exited, code=killed, status=6/ABRT
12/18/18 5:07 PM	systemd	packagekit.service: Failed with result 'signal'.

system info:

Operating System: Kubuntu 18.10
KDE Plasma Version: 5.14.4
Qt Version: 5.11.1
KDE Frameworks Version: 5.52.0
Kernel Version: 4.18.0-12-generic
OS Type: 64-bit


To reproduce, click the update plasmoid or click update inside Discover. Gnome Software just fails to retrieve the updates (there are 24 updated shown with pkcon update, Gnome Software shows zero).

This update bug (packagekit GUIs either not showing updates or crashing at update request) has existed for years on both rpm and deb distros, so not sure if KDE can do anything about it. Might be software sources causing a problem. It only sort of works on Fedora 29 in my experience.
Comment 1 Aleix Pol 2018-12-18 19:00:27 UTC
I can't really reproduce the issue, I get the following message when refreshing:

dic 18 19:59:18 user PackageKit[3748]: get-updates transaction /9796_cebdbdeb from uid 1001 finished with success after 469ms
dic 18 19:59:30 user PackageKit[3748]: get-updates transaction /9797_ebeaadcc from uid 1001 finished with success after 483ms

And it doesn't seem to crash either.
Comment 2 leftcrane 2018-12-18 20:56:47 UTC
Try with this repository.

# deb [arch=amd64] https://brave-browser-apt-release.s3.brave.com/ cosmic main 

For some reason, third-party repositories cause this problem. It's the same on Fedora, you have to tick them on/off one by one.

It only affects the frontends of PackageKit, not pkcon or apt.
Comment 3 leftcrane 2018-12-18 20:59:45 UTC
Turned out that it was just this one repository. However, Discover was giving me error messages with at least four apt lines. 

Unfortunately, I couldn't read or save those messages cause they appeared for only two seconds.
Comment 4 Aleix Pol 2018-12-19 00:27:50 UTC
You can get the output by running discover (plasma-discover) or the plasmoid (plasmawindowed org.kde.discovernotifier) on the terminal, you should be getting the errors there too.
Comment 5 Aleix Pol 2018-12-19 00:28:26 UTC
Will have to test with that apt sources line.
Comment 6 leftcrane 2018-12-22 21:16:46 UTC
It's not actually that particular line. Something must have jolted it back into working order after the apt-update, but now packagekit is back on its bullshit.

I wish I could help more, but this is all I see in the terminal:

org.kde.plasma.discover: Trying to open unexisting file QUrl("file:///home/USER/%25F")
invalid kns backend! "/etc/xdg/ksysguard.knsrc" because: "Config group not found! Check your KNS3 installation."
invalid kns backend! "/etc/xdg/servicemenu.knsrc" because: "Config group not found! Check your KNS3 installation."
adding empty sources model QStandardItemModel(0x563231df9fd0)
no packages for "ardour5.desktop"
no packages for "cockpit.desktop"
no packages for "com.teamviewer.TeamViewer"
no packages for "im.riot.webapp"
could not find "org.kde.development" ""
could not find "org.kde.development" ""
could not find "org.kde.development" ""
Transaction error:  "The PackageKit daemon has crashed" PackageKit::Transaction(0x563236c1bd70)
qml: message: The PackageKit daemon has crashed
no packages for "ardour5.desktop"
no packages for "cockpit.desktop"
no packages for "com.teamviewer.TeamViewer"
no packages for "im.riot.webapp"
PackageKit stopped running!
could not find "org.kde.development" ""

Gnome Software won't list updates either. But the updates are there and packagekit displays them fine from the terminal. This is some kind of longstanding bug that affects both Gnome Software and Discover.
Comment 7 leftcrane 2018-12-22 21:25:04 UTC
Created attachment 117068 [details]
Gnome software example error (one of many)

I've just loaded an example from Gnome Software. It says "failed to install", though I didn't ask it to install anything. Discover just reads "PackageKit crashed" every time.
Comment 8 leftcrane 2018-12-22 21:27:23 UTC
Output of "pkcon refresh force"


Refreshing cache              [=========================]         
Loading cache                 [=========================]         
Refreshing software list      [=========================]         
Downloading packages          [=========================]         
Running                       [=========================]         
Loading cache                 [                         ] (0%)  The daemon crashed mid-transaction!
Comment 9 leftcrane 2018-12-22 21:45:38 UTC
OK, turned out this was because the cosmic release was removed from the ppa I was using. (https://launchpad.net/~mdeguzis/+archive/ubuntu/libregeek)

If _any_ repository is down, packagekit can't refresh the cache. With COPR repos, if any repository lacks appdata, packagekit will cease to perform updates. Basically, if there is any problem with any repository, you will no longer be able to update your system. It's been like this for years.


Should a bug be filed upstream? At the very least, packagekit should have a disclaimer that says "you cannot use unofficial repositories and packagekit on the same system".
Comment 10 Aleix Pol 2018-12-25 03:57:09 UTC
Yes, please report here:
https://github.com/hughsie/PackageKit/issues

FWIW, PPA's are fine, if there's some kind of issue with yours, it should just get fixed.
Comment 11 leftcrane 2018-12-25 13:00:34 UTC
https://github.com/hughsie/PackageKit/issues/302

PPA's and COPR are supported, but if they misbehave in any way PK updates will stop working entirely. So they are poorly supported and users should be given fair warning. I wasted many hours trying to diagnose this.