Bug 1349518

Summary: Using excludes crashes PackageKit and Gnome Software
Product: [Fedora] Fedora Reporter: Devin Henderson <devin>
Component: PackageKitAssignee: Richard Hughes <rhughes>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 26CC: blacknova, bucky, devbacon, easdue, gronki, jameschambers2, jonathan, kevin, klember, luya, mystilleef, philosophy, rdieter, rhughes, sergio, smparrish
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-16 10:59:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Devin Henderson 2016-06-23 15:11:47 UTC
Description of problem:

gnome-software is broken and never updates. It looks like the problem is packagekit crashing. This happens on both my desktop and laptop. Both are F23 installs that I upgraded to F24 earlier this week with dnf. However, I can't be sure that this started happening when I upgraded to F24 because I rarely use gnome-software.

Version-Release number of selected component (if applicable):

gnome-software.x86_64                3.20.3-1.fc24                    @System
PackageKit.x86_64                    1.1.1-3.fc24                     @System
hawkey.x86_64                        0.6.3-2.fc24                     @System



How reproducible:

Running `pkcon -v refresh` crashes:


 devhen  ~  pkcon -v refresh
09:02:49	PackageKit          Verbose debugging enabled (on console 1)
09:02:49	PackageKit          filter=(null), filters=0
09:02:49	PackageKit          adding state 0x5604e21e70d0
09:02:49	PackageKit          role now refresh-cache
Refreshing cache              [                         ] (0%)  09:02:49	PackageKit          notify::connected
                              [=========================]         
Downloading repository information[=========================]         
Loading cache                 [=========================]         
Downloading repository information[=========================]         
Loading cache                 [                         ] (0%)  09:02:52	PackageKit          notify::connected
The daemon crashed mid-transaction!



Here are the log entries from journalctl:


Jun 23 08:55:50 localhost dbus[1018]: [system] Activating via systemd: service name='org.freedesktop.PackageKit' unit='packagekit.service'
Jun 23 08:55:50 localhost systemd[1]: Starting PackageKit Daemon...
Jun 23 08:55:50 localhost PackageKit[5307]: daemon start
Jun 23 08:55:50 localhost dbus[1018]: [system] Successfully activated service 'org.freedesktop.PackageKit'
Jun 23 08:55:50 localhost systemd[1]: Started PackageKit Daemon.
Jun 23 08:55:50 localhost audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=packagekit comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Jun 23 08:55:50 localhost polkitd[1191]: Registered Authentication Agent for unix-process:5302:229836 (system bus name :1.108 [/usr/bin/pkttyagent --notify-fd 10 --fallback], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf-8)
Jun 23 08:55:50 localhost PackageKit[5307]: uid 1000 is trying to obtain org.freedesktop.packagekit.system-sources-refresh auth (only_trusted:0)
Jun 23 08:55:50 localhost PackageKit[5307]: uid 1000 obtained auth for org.freedesktop.packagekit.system-sources-refresh
Jun 23 08:55:53 localhost packagekitd[5307]: packagekitd: /builddir/build/BUILD/hawkey-0.6.3/src/sack.c:838: hy_sack_add_excludes: Assertion `excl->size >= nexcl->size' failed.
Jun 23 08:55:53 localhost audit[5320]: ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:rpm_t:s0 pid=5320 comm="PK-Backend" exe="/usr/libexec/packagekitd" sig=6
Jun 23 08:55:53 localhost abrt-hook-ccpp[5359]: Process 5307 (packagekitd) of user 0 killed by SIGABRT - dumping core
Jun 23 08:55:53 localhost systemd[1]: packagekit.service: Main process exited, code=killed, status=6/ABRT
Jun 23 08:55:53 localhost polkitd[1191]: Unregistered Authentication Agent for unix-process:5302:229836 (system bus name :1.108, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.utf-8) (disconnected from bus)
Jun 23 08:55:53 localhost systemd[1]: packagekit.service: Unit entered failed state.
Jun 23 08:55:53 localhost audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=packagekit comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Jun 23 08:55:53 localhost systemd[1]: packagekit.service: Failed with result 'signal'.
Jun 23 08:55:53 localhost abrt-server[5360]: Deleting problem directory ccpp-2016-06-23-08:55:53-5307 (dup of ccpp-2016-06-21-13:33:30-1928)
Jun 23 08:55:53 localhost dbus[1018]: [system] Activating service name='org.freedesktop.problems' (using servicehelper)
Jun 23 08:55:53 localhost dbus[1018]: [system] Successfully activated service 'org.freedesktop.problems'

Comment 1 Devin Henderson 2016-06-23 15:23:35 UTC
It looks like this is caused by my exclude= line in /etc/yum.repos.d/fedora.repo which is:

exclude=kernel-devel kernel-debug-devel

If I comment out that line then it works.

Comment 2 Devin Henderson 2016-07-03 20:01:40 UTC
Any word on this? To summarize:

packagekit (and therefore gnome-software) crashes if any packages are excluded via exclude= in the base Fedora repo (/etc/yum.repos.d/fedora.repo).

Comment 3 easdue 2016-07-08 09:36:27 UTC
Same here I'm running kde and when I run packagekitd in the foreground and initiate an update check through the plasma widget packagekitd crashes with the following message: packagekitd: /builddir/build/BUILD/hawkey-0.6.3/src/sack.c:838: hy_sack_add_excludes: Assertion `excl->size >= nexcl->size' failed

Comment 4 Devin Henderson 2016-07-18 19:12:43 UTC
I'm now running PackageKit 1.1.3-1.fc24, the latest update, and this issue still persists.

Comment 5 Alan Schmidt 2016-08-01 14:31:02 UTC
I have what appears to be the same issue. However, I have different "excludes":

$ fgrep -i exclude *
fedora-updates.repo:exclude=xpra
rpmfusion-nonfree.repo:exclude=nautilus-dropbox


Similar log:
Aug  1 07:02:41 aschmidt packagekitd: packagekitd: /builddir/build/BUILD/hawkey-0.6.3/src/sack.c:838: hy_sack_add_excludes: Assertion `excl->size >=
 nexcl->size' failed.
Aug  1 07:02:41 aschmidt audit: ANOM_ABEND auid=4294967295 uid=0 gid=0 ses=4294967295 subj=system_u:system_r:rpm_t:s0 pid=14151 comm="PK-Backend" ex
e="/usr/libexec/packagekitd" sig=6
Aug  1 07:02:41 aschmidt abrt-hook-ccpp: Process 14113 (packagekitd) of user 0 killed by SIGABRT - dumping core
Aug  1 07:02:43 aschmidt plasmashell: PK error: "The PackageKit daemon has crashed" type: "process-kill"
Aug  1 07:02:43 aschmidt audit: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=packagekit comm="
systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=failed'
Aug  1 07:02:43 aschmidt systemd: packagekit.service: Main process exited, code=killed, status=6/ABRT
Aug  1 07:02:43 aschmidt systemd: packagekit.service: Unit entered failed state.
Aug  1 07:02:43 aschmidt systemd: packagekit.service: Failed with result 'signal'.


"pkcon update" has a somewhat different behavior:

# pkcon update
Getting updates               [========                 ] (35%)

...and here it will stay, silent, until killed.

Comment 6 mystilleef 2016-09-19 22:10:51 UTC
This bug seems to have flown under the radar. Some suggestions for the OP. 

1). Change the topic to "Excludes crashes PackageKit and Gnome Software". 

2). Set the priority severity of the bug to "High" 

Maybe that will catch the attention of maintainers. It's a shame this bug has existed for months now with no acknowledgement.

Comment 7 Alan Schmidt 2016-09-21 15:29:29 UTC
In the end, though, the impact to the end user isn't high.

The only real problem is that plasma-pk-updates runs by default, and there's no obvious replacement that uses a stable back-end.

dnf-automatic works fine. It just isn't ... you know ... sexy.

Comment 8 Devin Henderson 2016-09-21 17:05:15 UTC
@mystilleef I was told in the IRC channel (albeit, several weeks ago) that this was being looked into. But I'll try changing the title.

Personally this doesn't bother me a ton because I do not use any packagekit frontends for updates, I only use dnf, but I agree that this is a pretty nasty bug that has existed for too long.

Comment 9 James Chambers 2016-10-06 21:07:22 UTC
Had the same issue with:

gnome-software-3.20.4-1.fc24.x86_64
PackageKit-1.1.3-2.fc24.x86_64

The Software app would start, but nothing would load inside the "All" or "Installed" tabs. `pkcon refresh` would crash as described above.

Removing these exclude lines fixed `pkcon refresh`:

$ grep "exclude" *
fedora.repo:exclude=postgresql*
fedora-updates.repo:exclude=postgresql*

The Software app worked properly again after I commented out the exclude lines, ran `pkcon refresh`, and rebooted.

Comment 10 Alan Schmidt 2016-10-11 22:57:19 UTC
Bug 1377969 might be a duplicate of this one.

I say "might" because I'm seeing similar a similar backtrace at:

https://retrace.fedoraproject.org/faf/reports/1324126/

...and that references Bug 1377969, but I'm not allowed to see it. Ours is older, and it would be cuckoo-bananas to lock that one up but not this one, but there you go.

Comment 11 Dominik Gronkiewicz 2016-11-28 23:58:33 UTC
Same behavior here. Please fix it :(

Comment 12 Dominik Gronkiewicz 2016-12-18 00:50:43 UTC
Hmmm I guess it works on 25?

Comment 13 Devin Henderson 2016-12-29 01:01:34 UTC
Yep, this appears to be fixed for me now on F25.

Comment 14 Devin Henderson 2017-01-04 03:29:41 UTC
Can we go ahead and close this? Is anyone else still having the problem? It seems to be fixed for since upgrading to F25.

Comment 15 Rex Dieter 2017-02-01 15:36:08 UTC
*** Bug 1350732 has been marked as a duplicate of this bug. ***

Comment 16 Sergio Basto 2017-02-01 19:04:43 UTC
Not fixed in F24 

The daemon crashed mid-transaction!

Comment 17 Edmund Bacon 2017-03-31 16:59:09 UTC
(In reply to Sergio Monteiro Basto from comment #16)
> Not fixed in F24 
> 
> The daemon crashed mid-transaction!

This has been fixed in F25, and the F25 RPMS will install in F24. You'll need
PackageKit
PackageKit-glib
PackageKit-gstreamer-plugin

Comment 18 Luya Tshimbalanga 2017-04-02 04:32:50 UTC
(In reply to Devin Henderson from comment #14)
> Can we go ahead and close this? Is anyone else still having the problem? It
> seems to be fixed for since upgrading to F25.

Sadly no. Although the crash issue is resolved, the side effect is "exclude" parameter is not honoured by PackageKit inside repo file. 

For example, I use copr repository for the kernel 4.9.x and exclude an upgrade from fedora-updates.repo to kernel 4.10.x as illustrated below:
$ grep "exclude" *
fedora-updates.repo:exclude=kernel*

$ dnf check-update | grep kernel

Despite clearing the cache with "pkcon refresh force"

$ pkcon get-updates | grep kernel
Available    kernel-4.10.6-200.fc25.x86_64 (updates)
Available    kernel-core-4.10.6-200.fc25.x86_64 (updates)
Available    kernel-headers-4.10.6-200.fc25.x86_64 (updates)
Available    kernel-modules-4.10.6-200.fc25.x86_64 (updates)

Comment 19 Fedora End Of Life 2017-07-25 21:15:06 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 20 Devin Henderson 2017-07-25 21:37:46 UTC
@Luya Tshimbalanga:

Is that happening to you on F25 or F26? Lets keep this ticket open and reassign it to the correct Fedora version and hopefully we'll get a response on that issue.

Comment 21 Luya Tshimbalanga 2017-07-26 23:36:54 UTC
(In reply to Devin Henderson from comment #20)
> @Luya Tshimbalanga:
> 
> Is that happening to you on F25 or F26? Lets keep this ticket open and
> reassign it to the correct Fedora version and hopefully we'll get a response
> on that issue.

Not sure yet. If it safe to assign "version" to 26 for the time being.

Comment 22 Luya Tshimbalanga 2017-07-29 20:14:05 UTC
Sadly it is still happening. PackageKit does not honour exclude parameter.

Comment 23 Sergio Basto 2017-10-16 10:59:04 UTC
I'm marking as duplicated becuase there is no point have 2 bugs where we talk of same thing ...

*** This bug has been marked as a duplicate of bug 1256108 ***