Bug 1696204 - dnf should enable parent-required-modules if user specify exact module version to install. Or print missing installed modules.
Summary: dnf should enable parent-required-modules if user specify exact module versio...
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.2
Hardware: Unspecified
OS: Unspecified
Target Milestone: rc
: 8.0
Assignee: Jaroslav Mracek
QA Contact: Jan Blazek
Depends On:
TreeView+ depends on / blocked
Reported: 2019-04-04 10:35 UTC by Andrei Stepanov
Modified: 2021-02-16 14:13 UTC (History)
4 users (show)

Fixed In Version: dnf-4.2.17-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-04-28 16:47:40 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:1823 0 None None None 2020-04-28 16:47:54 UTC

Description Andrei Stepanov 2019-04-04 10:35:34 UTC
Suppose user enabled module perl-DBD-SQLite:1.58

# dnf module reset perl-DBD-SQLite
# dnf module enable perl-DBD-SQLite

At this point user enabled all modules: "perl-DBD-SQLite" that have stream "1.58"

Next user wants to install specific version of module "perl-DBD-SQLite" specifying: NSVC

# dnf module install perl-DBD-SQLite:1.58:8010020190322125518:e74546ca

Remember? Module is enabled.

But this command will fail. Because required modules are not installed:

Modulemd for perl-DBD-SQLite:1.58:8010020190322125518:e74546ca has:

      perl: [5.24]
      perl-DBI: [1.641]
      platform: [el8]

DNF doesn't print any understanding explanation, why NSVC cannot be installed. However, module is enabled.

Currently user must also do:

# dnf module reset perl
# dnf module enable perl:5.24

This is not obvious. Child-module-expansion must install required parent-modules.

Otherwise, user cannot understand why module is enabled but is not installable.
I doubt that user will go and read read modulemd for perl-DBD-SQLite what it requires.

If you do not want to do this, than please, just print some useful info such as:

Requirements to install perl-DBD-SQLite:1.58:8010020190322125518:e74546ca is not satisfied.

Missing required installed modules: 
perl: 5.24

Comment 1 Jaroslav Mracek 2019-04-09 10:14:52 UTC
I investigated the issue, and I found that the problem is caused by preferring of a context using default stream. This is more restrictive behaviorDue to latest changes that should not allow stream switch I would not recommend to change the behavior.

The issue could be resolved enabling perl:5.24 manually.

Comment 2 Andrei Stepanov 2019-04-09 10:30:15 UTC
Jaroslav, hi.

I agree that "The issue could be resolved enabling perl:5.24 manually."

But, problem is users doesn't know that he needs enable perl:5.24 manually. Or Perl:5.26 or perl:6.01

DNF doesn't give any clue/hint why it fails.

There should be some meaningful info from DNF. something like: this NSVC has next requires:

|                        |
| # DEPENDENCY           |
|                        |
| Modules to be enabled: |
|                        |
|    * perl:5.24         |
|    * perl-DBI:1.641    |
|                        |

1. user will blame DNF.
2. user mast manually inspect md file to figure out why it fails.

Now DNF fails in very unfriendly manner.

Hope for your understanding.

Comment 3 Jaroslav Mracek 2019-04-09 12:42:50 UTC
We need an opinion about required behavior from Modularity team.

Comment 5 Petr Šabata 2019-07-31 11:07:49 UTC
I agree the current behavior is a consequence of the restrictive stream switching behavior and should be kept.
However, I also agree DNF should provide some more information to guide the user in the right direction; even if just by saying that the required context is available but couldn't be installed because of unment module-level dependencies.  Would that be possible?

Comment 6 Jaroslav Mracek 2019-11-14 10:05:22 UTC
I enhanced the error message (see output bellow) - https://github.com/rpm-software-management/dnf/pull/1532. Please do you agree with proposed solution?

# dnf module install perl-DBI:1.641:820190116185335:082fdf2f
All matches for argument 'perl-DBI:1.641:820190116185335:082fdf2f' in module 'perl-DBI:1.641' are not active
Error: Problems in request:
broken groups or modules: perl-DBI:1.641:820190116185335:082fdf2f

Comment 7 Andrei Stepanov 2019-11-14 10:23:29 UTC
Jaroslav Mracek 
It looks match better now. Thank you.

Comment 15 errata-xmlrpc 2020-04-28 16:47:40 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


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