Bug 1585231

Summary: [install_specs] install_specs() should be able to ignore missing/nonexistent packages if requested
Product: [Fedora] Fedora Reporter: Martin Kolman <mkolman>
Component: dnfAssignee: Martin Hatina <mhatina>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmach, mhatina, packaging-team-maint, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
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: 2018-06-05 07:40:07 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:
Attachments:
Description Flags
packaging.log from the installation attempt
none
anaconda.log from the installation attempt none

Description Martin Kolman 2018-06-01 15:11:21 UTC
NOTE: This bug report concerns the install_specs branch of DNF, where the API Anaconda needs for module installation support is being stabilized.

(https://github.com/mhatina/dnf/tree/install_specs)

I'm also using libdnf-0.11.1-1.git.1585.5244e5d.fc28.x86_64.rpm together with the DNF branch.


Description of problem:
Previously we used to add individual package and group requirements one by one to the DNF transaction, so we also got any errors immediately after we tried to add an invalid requirement, such as a missing/non-existing package/group.

This is also how the --ignoremissing flag for the --packages section[0] has been implemented, Anaconda simply ignored any package-missing errors DNF raised.

On the other hand, when using the install_specs() function, will gather all package/group/module include & exclude specs and pass them to DNF. Turns out this is a problem for implementing the --ignoremissing functionality, as any error in what we have requested from DNF (such as a missing/non-existing package/group) will abort the whole DNF transaction.

In short, we need to be able to tell dnf to ignore missing groups/packages when needed. Ideally just some flag we would pass to DNF to switch it to this mode.

On a related note, it would still be good to record any packages/groups that have been ignored in this way - DNF could log these or provide a list of ignored packages/groups, maybe as a return value of the install_specs() function or possibly as a property of the Base instance, etc.

Version-Release number of selected component (if applicable):
commit 1263ddc0ebf7bcc6496d90225ddaca4fdf47c1f1 (HEAD -> install_specs, mhatina/install_specs)
Author: Martin Hatina <mhatina>
Date:   Tue May 29 13:37:27 2018 +0200

How reproducible:
always

Steps to Reproduce:
1. request at least one missing/not-existing package via install_specs() function


Actual results: The call fails and there is nothing that can be really done about it.


Expected results: It should be possible to tell DNF to ignore missing packages/groups so that install_specs() can be called with missing packages.


[0] http://pykickstart.readthedocs.io/en/latest/kickstart-docs.html#chapter-6-package-selection

Comment 1 Martin Kolman 2018-06-04 09:54:56 UTC
This is the traceback from DNF that happens if a missing/not-existing package is requested via install_specs():

  File "/tmp/updates/pyanaconda/payload/dnfpayload.py", line 562, in _apply_selections
    self._base.install_specs(install=include_list, exclude=exclude_list)

  File "/tmp/updates/dnf/base.py", line 1857, in install_specs
    self.install(spec, strict=self.conf.strict)

  File "/tmp/updates/dnf/base.py", line 1913, in install
    raise dnf.exceptions.MarkingError(_('no package matched'), pkg_spec)

dnf.exceptions.MarkingError: no package matched

Comment 2 Martin Kolman 2018-06-04 09:56:11 UTC
Created attachment 1447379 [details]
packaging.log from the installation attempt

Comment 3 Martin Kolman 2018-06-04 09:56:50 UTC
Created attachment 1447380 [details]
anaconda.log from the installation attempt

Comment 4 Martin Hatina 2018-06-05 07:40:07 UTC
Fixed in https://github.com/mhatina/dnf/tree/install_specs