Bug 1170562 - [Build 20200425] pkcon returns 'error' if 'nothing to be done'
[Build 20200425] pkcon returns 'error' if 'nothing to be done'
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: GNOME
Current
Other Other
: P5 - None : Normal (vote)
: ---
Assigned To: Jonathan Kang
E-mail List
https://openqa.opensuse.org/tests/124...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-27 09:15 UTC by Dominique Leuenberger
Modified: 2020-09-24 13:18 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dominique Leuenberger 2020-04-27 09:15:27 UTC
## Observation

openQA test in scenario opensuse-Tumbleweed-DVD-x86_64-upgrade_Leap_42.3_kde@64bit fails in
[vlc](https://openqa.opensuse.org/tests/1245759/modules/vlc/steps/12)

pkcon exits with error 7 (transaction error) if a user requests to install a package that is already there. 'Nothing to be done' is not a transaction error. This could/should be handled the same way as zypper does and exit 0 (the 'request was fullfilled, the package is now installed; even though we did not have to do anything for it)


## Test suite description



## Reproducible

Fails since (at least) Build [20200425](https://openqa.opensuse.org/tests/1245759) (current job)


## Expected result

Last good: [20200423](https://openqa.opensuse.org/tests/1244952) (or more recent)


## Further details

Always latest result in this scenario: [latest](https://openqa.opensuse.org/tests/latest?arch=x86_64&distri=opensuse&flavor=DVD&machine=64bit&test=upgrade_Leap_42.3_kde&version=Tumbleweed)
Comment 1 Jonathan Kang 2020-05-20 02:52:09 UTC
The test case is written based on a falsely-functional zypp backend which simply
reinstalling the package even if it's already installed. This has been fixed
a few months ago in the zypp backend.

The way PK behaves now in openSUSE is on part with other distributions and the
way upstream expects. Nothing can be done at our side atm.
Comment 2 Dominique Leuenberger 2020-05-20 07:04:09 UTC
(In reply to Jonathan Kang from comment #1)

> The way PK behaves now in openSUSE is on part with other distributions and
> the
> way upstream expects. Nothing can be done at our side atm.

'nothing can be done' is never correct, and certainly not when taking into account that Richard Hughes is upstream. He's always very open to discussions and arguments.

'Nothing to be done' because everything is already installed is imho not an error, only information - so retval == 0 sounds plausible
Comment 3 Jonathan Kang 2020-05-20 08:15:07 UTC
(In reply to Dominique Leuenberger from comment #2)
> 'nothing can be done' is never correct, and certainly not when taking into
> account that Richard Hughes is upstream. He's always very open to
> discussions and arguments.

Right. Feel free to report this upstream so that we can work something out with
Richard together.
> 
> 'Nothing to be done' because everything is already installed is imho not an
> error, only information - so retval == 0 sounds plausible

Currently, most PK errors are simply translated into transaction-failed in the
implementation of pkcon. There certainly are some improvements to be made.
Comment 4 Dominique Leuenberger 2020-06-11 15:31:09 UTC
Had a quick chat with Richard about this topic; we can consider this a bug in PK, that does not follow the man page for this special case:

from the man page
>RETURN VALUES
>       0
>           Success
>
>       1
>           Failed with miscellaneous internal error.
>
>       3
>           Failed with syntax error, or failed to parse command.
>
>       4
>           Failed as a file or directory was not found.
>
>       5
>           Nothing useful was done.
>
>       6
>           The initial setup failed, e.g. setting the network proxy.
>
>       7
>           The transaction failed, see the detailed error for more information.

so, pkcon should return '5' in case it has 'nothing to do'
Comment 5 Dominique Leuenberger 2020-06-11 16:03:05 UTC
submitted

https://github.com/hughsie/PackageKit/pull/405

which aligns pkcon to the documentation (this requires another change on openQA!)
Comment 6 OBSbugzilla Bot 2020-06-16 13:50:30 UTC
This is an autogenerated message for OBS integration:
This bug (1170562) was mentioned in
https://build.opensuse.org/request/show/815257 Factory / PackageKit
Comment 8 Jonathan Kang 2020-06-19 05:54:23 UTC
Thank you! Dominique.

The fix has been submitted to GNOME:Factory and SLE product.

Closing this.
Comment 9 Swamp Workflow Management 2020-07-20 19:15:36 UTC
SUSE-RU-2020:1961-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 1170562
CVE References: 
Sources used:
SUSE Linux Enterprise Workstation Extension 15-SP2 (src):    PackageKit-1.1.13-4.3.1
SUSE Linux Enterprise Module for Desktop Applications 15-SP2 (src):    PackageKit-1.1.13-4.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 10 Swamp Workflow Management 2020-09-24 13:18:40 UTC
openSUSE-RU-2020:1515-1: An update that has one recommended fix can now be installed.

Category: recommended (moderate)
Bug References: 1170562
CVE References: 
JIRA References: 
Sources used:
openSUSE Leap 15.2 (src):    PackageKit-1.1.13-lp152.3.3.1