Bug 91030 - pkcon offline-status does not show failed transactions details
Summary: pkcon offline-status does not show failed transactions details
Status: RESOLVED FIXED
Alias: None
Product: PackageKit
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Richard Hughes
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-19 13:00 UTC by Kamil Páral
Modified: 2015-06-23 14:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
failure dialog after reboot (281.65 KB, image/png)
2015-06-19 13:02 UTC, Kamil Páral
Details
pkcon get-transactions output (3.02 KB, text/plain)
2015-06-19 13:03 UTC, Kamil Páral
Details
prepared-update file (6.96 KB, text/plain)
2015-06-19 13:03 UTC, Kamil Páral
Details
system journal from the upgrade (141.22 KB, text/plain)
2015-06-19 13:04 UTC, Kamil Páral
Details
file listing of /var/cache/PackageKit (20.87 KB, text/plain)
2015-06-19 13:04 UTC, Kamil Páral
Details
rpm -qa of the system (83.47 KB, text/plain)
2015-06-19 13:04 UTC, Kamil Páral
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kamil Páral 2015-06-19 13:00:23 UTC
Today my offline upgrade transaction failed, and after reboot I was greeted with a gtk dialog showing the details (attached). I closed it, because I wanted to inspect the error in console using `pkcon offline-status`. To my surprise, all it said was:

$ pkcon offline-status
Command failed: no update results available

That is not true, because the dialog clearly spoke about file conflicts between packages. I went to inspect `pkcon get-transactions`:

Transaction: /1727_bebcaaea
 System time: 2015-06-19T09:35:29.898878Z
 Succeeded: False
 Role: update-packages
 Duration: 60822 (seconds)
 Command line: 
 User ID: 0
 Username: root
 Real name: root
 Affected packages: None

No details either. Finally I found the error in `journalctl -b -1`:

Jun 19 11:36:30 kraken PackageKit[520]: update-packages transaction /1727_bebcaaea from uid 0 finished with failed after 60822ms
Jun 19 11:36:30 kraken pk-offline-update[509]: status finished
Jun 19 11:36:30 kraken packagekitd[520]: error: rpmdb: BDB0164 close: Bad file descriptor
Jun 19 11:36:30 kraken packagekitd[520]: error: rpmdb: Basenames: Bad file descriptor
Jun 19 11:36:30 kraken packagekitd[520]: error: db5 error(9) from db->close: Bad file descriptor
Jun 19 11:36:31 kraken pk-offline-update[509]: writing failed results
Jun 19 11:36:31 kraken pk-offline-update[509]: failed to update system: Error running transaction: file /usr/bin/git from install of git-2.4.3-2.fc22.
x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-cor
e-2.4.3-1.fc22.x86_64
                                               file /usr/bin/git-receive-pack from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-cor
e-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-receive-pack from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/bin/git-shell from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-shell from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/bin/git-upload-archive from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-upload-archive from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/bin/git-upload-pack from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-upload-pack from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-add from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-annotate from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-apply from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-archive from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-bisect--helper from install of git-2.4.3-2.fc22.x86_64 conflicts with file from git-core-2.4.3-1.fc22.x86_64
                                               file /usr/libexec/git-core/git-blame from install o
Jun 19 11:36:41 kraken pk-offline-update[509]: rebooting


The upgrade issue was caused git-2.4.3-2.fc22 improperly obsoleting older packages and having file conflicts. Not a PK problem. But it seems that pkcon cli utilities don't show the error in such cases, and that seems to be a bug. I have no idea where the gtk dialog took the error from (directly from journal?), but if the user dismisses the notification/dialog, it's difficult to find the cause of the failure - instead of relying on pkcon the user has to go dig through journal.

I assume pkcon offline-status (and get-transactions) should be able to print the same error message as the gtk dialog displayed?


Reproducer:
1. prepare an offline transactions with file conflicts. You can reuse git-2.4.3-2.fc22 for that, available at http://koji.fedoraproject.org/koji/buildinfo?buildID=646090 .
2. run the offline update, it fails
3. after reboot, you'll see the error details in a dialog
4. but pkcon offline-status or get-transactions will not show it


gnome-packagekit-3.16.0-1.fc22.x86_64
gnome-software-3.16.3-1.fc22.x86_64
hawkey-0.5.7-1.fc22.x86_64
libhif-0.2.0-4.fc22.x86_64
librepo-1.7.16-1.fc22.x86_64
PackageKit-1.0.6-6.fc22.x86_64
PackageKit-cached-metadata-1.0.6-6.fc22.x86_64
PackageKit-command-not-found-1.0.6-6.fc22.x86_64
PackageKit-glib-1.0.6-6.fc22.x86_64
PackageKit-gstreamer-plugin-1.0.6-6.fc22.x86_64
PackageKit-gtk3-module-1.0.6-6.fc22.x86_64
python3-hawkey-0.5.7-1.fc22.x86_64
python3-librepo-1.7.16-1.fc22.x86_64
python-hawkey-0.5.7-1.fc22.x86_64
python-librepo-1.7.16-1.fc22.x86_64
rpm-4.12.0.1-9.fc22.x86_64
rpm-libs-4.12.0.1-9.fc22.x86_64
rpm-plugin-selinux-4.12.0.1-9.fc22.x86_64
rpm-plugin-systemd-inhibit-4.12.0.1-9.fc22.x86_64
rpm-python3-4.12.0.1-9.fc22.x86_64
rpm-python-4.12.0.1-9.fc22.x86_64
Comment 1 Kamil Páral 2015-06-19 13:02:10 UTC
Created attachment 116594 [details]
failure dialog after reboot

Sorry for Czech language, it says "Update Failed. Offline update failed in an unexpected way. Here are the failure details retrieved from the package manager:"
Comment 2 Kamil Páral 2015-06-19 13:03:30 UTC
Created attachment 116595 [details]
pkcon get-transactions output

Showing the successful transaction of downloading the packages, and then the failed transaction of offline update, with no details.
Comment 3 Kamil Páral 2015-06-19 13:03:42 UTC
Created attachment 116596 [details]
prepared-update file
Comment 4 Kamil Páral 2015-06-19 13:04:05 UTC
Created attachment 116597 [details]
system journal from the upgrade
Comment 5 Kamil Páral 2015-06-19 13:04:26 UTC
Created attachment 116598 [details]
file listing of /var/cache/PackageKit
Comment 6 Kamil Páral 2015-06-19 13:04:42 UTC
Created attachment 116599 [details]
rpm -qa of the system
Comment 7 Kamil Páral 2015-06-20 09:33:59 UTC
I've found out that you can also simulate a similar behavior, if you adjust "prepared-update" before rebooting into offline upgrade. I.e. remove some package line (do not break deps), delete the package from the correct directory, and try to perform offline upgrade. It will fail, the but error message will again only be reachable in the gtk dialog, not in the command line tools.
Comment 8 Kamil Páral 2015-06-22 11:47:19 UTC
I just received another offline upgrade error:

cannot download a/abrt-2.6.0-1.fc22.x86_64.rpm to /var/cache/PackageKit/metadata/updates/packages/: Curl error (6): Couldn't resolve host name for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f22&arch=x86_64 [Could not resolve host: mirrors.fedoraproject.org]

But again, pkcon doesn't say anything:
$ pkcon offline-status 
Command failed: no update results available

$ pkcon get-transactions
Transaction: /1845_dcaaecce
 System time: 2015-06-22T11:11:16.218055Z
 Succeeded: False
 Role: update-packages
 Duration: 6574 (seconds)
 Command line: 
 User ID: 0
 Username: root
 Real name: root
 Affected packages:
 - downloading abrt-2.6.0-1.fc22.x86_64
Comment 9 Kalev Lember 2015-06-23 14:19:42 UTC
Should be fixed with https://git.gnome.org/browse/gnome-software/commit/?id=786999077324e4314c86a9f65683b24389ad6233 , thanks!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.