Bug 848518 - wrong exit codes
wrong exit codes
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: PackageKit (Show other bugs)
All Linux
unspecified Severity medium
: beta
: 7.0
Assigned To: Richard Hughes
Desktop QE
Depends On:
  Show dependency treegraph
Reported: 2012-08-15 15:43 EDT by Vladimir Benes
Modified: 2014-06-13 07:49 EDT (History)
4 users (show)

See Also:
Fixed In Version: PackageKit-0.8.6-1.el7
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-06-13 07:49:06 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Vladimir Benes 2012-08-15 15:43:09 EDT
Description of problem:
I've found a lot of wrong exit codes. I've decided to file them all into one place as it looks like some of those can be for discussion

exit code 0:

    pkcon --non_existing_option

    download errors (disabled network)

    failed to parse error  (pkcon --cache-age=sda or so) 

    missing argument for cache-age returns 0
    already installed package error when installing locally returns 0 (should be 5)
    pkcon local-install (on invalid package - no rpm)
    fatal erorr: user declined simulation (when declined dependencies)

    pkcon install unavailable has 1

    fatal error user declined interaction (installing unsigned package declined)

    fatat error: no transaction to process (pkcon update kernel when updated)

    fatal error: nothing to do (pkcon update on updated system)

    fatal error: cannot refresh cache when offline (pkcon refresh when offline)

    pkcon get-depends setup (no more depends .. shouldn't it be 5 instead of 0?)

    pkcon get-requires mc (no requires returned still 0?)

    Fatal error: Trying to remove "yum", which is protected (pkcon get-requires glibc)

    Fatal error: Error getting repository data for alpha23, repository not found (enable non existing repo)

        ditto with disable invalid repo)

    no requires found by pkcon get-requires mc (is 0 shouldn't be 5?)

    pkcon repo enable/disable of enabled/disabled repo shoudl return 5 not 0

Version-Release number of selected component (if applicable):
Comment 2 Vladimir Benes 2012-08-16 09:38:23 EDT
I've got one more :

when dependencies are not available there is 0 as well

Resolving dependencies        [=========================]         
Fatal error: gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-glib-2.0.so.8(SPICEGTK_1)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gobject-1.0.so.0(LIBVIRT_GOBJECT_0.0.9)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-gtk-3.0.so.4(SPICEGTK_1)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gconfig-1.0.so.0(LIBVIRT_GCONFIG_0.1.0)(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-glib-2.0.so.8()(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libspice-client-gtk-3.0.so.4()(64bit)
gnome-boxes-3.5.5-1.el7.x86_64 requires libvirt-gconfig-1.0.so.0(LIBVIRT_GCONFIG_0.0.9)(64bit)
[root@rhle7alpha2 repo]# echo $?
Comment 3 Vladimir Benes 2012-08-16 09:50:48 EDT
and one more:
when installing with no network after a download error there is 0 returned.
Comment 4 Vitezslav Humpa 2012-08-21 07:02:10 EDT
I've also found that:

Fatal error: GDBus.Error:org.gtk.GDBus.UnmappedGError.Quark._pk_5ftransaction_5ferror.Code11: The search string length is too large

exits with value of 0.
Comment 5 Richard Hughes 2012-11-29 06:32:08 EST
I've fixed *loads* of these in the last release, can you please retest with PackageKit-0.8.6-1.el7 -- thanks!
Comment 6 Matthias Clasen 2013-01-17 16:07:21 EST
moving to modified, then
Comment 7 smatula 2013-11-21 09:57:43 EST
Fix Verified with Build RHEL-7.0-20131115.2 x86_64 PackageKit-0.8.9-8.el7.

All negative error scenarios that produce error status other 5 pass and now produce a non 0 error status.
Four scenarios still produce error status of 0 where status of 5 is expected.
Error Status 5 is 'Nothing useful was done.' These are the following:
pkcon repo-enable  a already enabled repo.
pkcon repo-disable a already disabled repo.
pkcon get-depends setup   (no depends - no results)
pkcon get-requires mc     (no requires - no results)

Opening new bug for this case and the four scenarios.
Comment 8 Ludek Smid 2014-06-13 07:49:06 EDT
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.

Note You need to log in before you can comment on or make changes to this bug.