Bug 1544407 - 'dnf group list' fails with traceback when comps.xml is empty
Summary: 'dnf group list' fails with traceback when comps.xml is empty
Keywords:
Status: CLOSED DUPLICATE of bug 1537957
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 27
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-12 11:58 UTC by Eva Mrakova
Modified: 2018-02-13 06:21 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-02-13 06:21:49 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Eva Mrakova 2018-02-12 11:58:43 UTC
Description of problem:
'dnf group list' fails with traceback when comps.xml in an enabled repository is empty

Related bug 830739 has been reported for yum in the past.

Version-Release number of selected component (if applicable):
dnf-2.7.5-2.fc27.noarch

How reproducible:
always

Steps to Reproduce:
1. create a repo with empty comps.xml
   (e.g. in a directory with some .rpm files run
    # touch comps.xml
    # createrepo_c -g comps.xml .
    and create a .repo file with baseurl pointing to that directory)
2. run
   # dnf group list

Actual results:
# dnf --disablerepo=\* --enablerepo=dummyrepo group list
Last metadata expiration check: 0:18:35 ago on Mon 12 Feb 2018 06:33:00 AM EST.
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.6/site-packages/dnf/cli/main.py", line 179, in user_main
    errcode = main(args)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
    cli.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1014, in run
    return self.command.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/group.py", line 375, in run
    self._grp_setup()
  File "/usr/lib/python3.6/site-packages/dnf/cli/commands/group.py", line 108, in _grp_setup
    self.base.read_comps(arch_filter=True)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 550, in read_comps
    self._comps._add_from_xml_filename(decompressed)
  File "/usr/lib/python3.6/site-packages/dnf/comps.py", line 328, in _add_from_xml_filename
    ret = comps.fromxml_f(fn)
_libpycomps.ParserError: Fatal parser error


Expected results:
no traceback

Additional info:
/CoreOS/yum/Regression/bz830739-yum-langpacks-tracebacks-comps-xml-has-zero-length can help to create a reproducer

Comment 1 Marek Blaha 2018-02-13 06:21:49 UTC

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


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