#52 Don't traceback when missing metadata
Closed: RESOLVED 6 years ago Opened 6 years ago by sgallagh.

I installed fedmod from the COPR and ran fedmod where-is-package uboot-tools and got a traceback:

ERROR:root:Unexpected exception
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/_fedmod/cli.py", line 172, in run
    rq.list_modules_for_rpm(cli.args.pkg)
  File "/usr/lib/python3.6/site-packages/_fedmod/module_repoquery.py", line 23, in list_modules_for_rpm
    _repodata._populate_module_reverse_lookup()
  File "/usr/lib/python3.6/site-packages/_fedmod/_repodata.py", line 170, in _populate_module_reverse_lookup
    repomd_xml = etree.parse(repomd_fname)
  File "src/lxml/etree.pyx", line 3444, in lxml.etree.parse (src/lxml/etree.c:83185)
  File "src/lxml/parser.pxi", line 1834, in lxml.etree._parseDocument (src/lxml/etree.c:120757)
  File "src/lxml/parser.pxi", line 1860, in lxml.etree._parseDocumentFromURL (src/lxml/etree.c:121104)
  File "src/lxml/parser.pxi", line 1764, in lxml.etree._parseDocFromFile (src/lxml/etree.c:120012)
  File "src/lxml/parser.pxi", line 1161, in lxml.etree._BaseParser._parseDocFromFile (src/lxml/etree.c:114561)
  File "src/lxml/parser.pxi", line 598, in lxml.etree._ParserContext._handleParseResultDoc (src/lxml/etree.c:107738)
  File "src/lxml/parser.pxi", line 709, in lxml.etree._handleParseResult (src/lxml/etree.c:109447)
  File "src/lxml/parser.pxi", line 636, in lxml.etree._raiseParseError (src/lxml/etree.c:108258)
OSError: Error reading file '/home/sgallagh/.cache/fedmod/repos/f27-modules/x86_64/repodata/repomd.xml': failed to load external entity "/home/sgallagh/.cache/fedmod/repos/f27-modules/x86_64/repodata/repomd.xml"

By running fedmod --help I was able to see that I should probably have run fedmod fetch-metadata first. We should really catch this error and suggest this action. The traceback is unfriendly.


PR: https://pagure.io/modularity/fedmod/pull-request/53

New output:

$ fedmod list-modules
'/home/ncoghlan/.cache/fedmod/repos/f27-modules/x86_64/repodata/repomd.xml' does not exist. Run `fedmod fetch-metadata`.

The later checks switch the resolution advice to "Try running fedmod fetch-metadata again.", since the first check passing but the later checks failing indicates that the command has been run, it just didn't work properly for some reason (e.g. they Ctrl-C'ed out before the download was finished).

Metadata Update from @asamalik:
- Issue close_status updated to: RESOLVED
- Issue status updated to: Closed (was: Open)

6 years ago

Login to comment on this ticket.

Metadata