Bug 1609292 - dnf should not error out when an entry in the <optionlist> for an environment group does not exist
Summary: dnf should not error out when an entry in the <optionlist> for an environment...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 29
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-27 13:21 UTC by Andre Robatino
Modified: 2018-12-04 11:40 UTC (History)
10 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-12-04 11:40:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1609289 0 unspecified CLOSED dnf traceback when groupinstall command fails 2021-02-22 00:41:40 UTC

Internal Links: 1609289

Description Andre Robatino 2018-07-27 13:21:31 UTC
Description:
Not sure how to fill in the rest of the fields. You should be able to figure it out from the following traceback. I also filed https://bugzilla.redhat.com/show_bug.cgi?id=1609289 against dnf for the fact that it shouldn't crash in this situation. See https://lists.fedoraproject.org/archives/list/test@lists.fedoraproject.org/thread/4GQ7UYUJRANWHSC4VDW33CA5VSG5D45O/ .

[root@localhost ~]# dnf groupinstall basic-desktop-environment
Last metadata expiration check: 1:44:13 ago on Fri 27 Jul 2018 03:39:28 AM EDT.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 115, in cli_run
    cli.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1041, in run
    return self.command.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/group.py", line 423, in run
    self.base.conf.strict)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 1662, in env_group_install
    cnt += self.environment_install(env_id, types, strict=strict)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 1590, in environment_install
    strict)
  File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 93, in install_or_skip
    return install_fnc(grp_or_env_id, types, exclude, strict)
  File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 564, in _environment_install
    for comps_group in comps_env.optional_groups:
  File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 262, in optional_groups
    return [self._build_group(gi) for gi in self.option_ids]
  File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 262, in <listcomp>
    return [self._build_group(gi) for gi in self.option_ids]
  File "/usr/lib/python3.7/site-packages/dnf/comps.py", line 249, in _build_group
    raise ValueError(msg % (grp_id.name, self.id))
ValueError: no group 'hawaii-desktop' from environment 'basic-desktop-environment'
[root@localhost ~]#

Packages to be added: 

Comps group:  

Default: 

Mandatory: 

Visible: 

Multi-lib: 

Need to be present for arches:

Comment 1 Adam Williamson 2018-07-27 22:22:49 UTC
Should be fixed by https://pagure.io/fedora-comps/c/470ba2cd9ce321e2b797db0886072f6c965260c4?branch=master (for f27 and f28 also).

Comment 2 Adam Williamson 2018-08-01 16:04:45 UTC
Note this is also kinda an anaconda/dnf bug - 'hawaii-desktop' was only an *option group* (in <optionlist>) for the 'basic-desktop' environment group (meaning it wouldn't be installed as part of the environment group by default, but would show up on the right-hand side list of optional additional groups in the anaconda UI). It seems wrong that anaconda/dnf fail/crash when an option group does not exist; it's arguably reasonable to fail if a *regular* group (in <grouplist>) does not exist, but failing on non-existent <optionlist> entries seems excessive.

I believe this is already being addressed, but let's re-open the bug just to make sure.

Comment 3 Andre Robatino 2018-08-01 17:46:33 UTC
I already filed https://bugzilla.redhat.com/show_bug.cgi?id=1609289 against dnf. Should that be marked as a duplicate of this?

Comment 4 Adam Williamson 2018-08-01 17:58:53 UTC
Let's mark this as a dupe of that...

*** This bug has been marked as a duplicate of bug 1609289 ***

Comment 5 Adam Williamson 2018-08-01 18:00:44 UTC
Actually, on second thoughts, let's not. There are really two issues here. Let's have two bugs.

*This* bug should be for "dnf back end should not raise an error at all when the missing group is only an option group". The other bug can be for "dnf CLI should fail more gracefully when the back end raises an exception like this".

Comment 6 Jan Kurik 2018-08-14 11:02:01 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 7 Jaroslav Mracek 2018-12-04 11:40:36 UTC
It looks like that the problem is fixed in dnf-4.0.9-1. Please if you can still reproduce it, don't hesitate to reopen the bug report.


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