Bug 471873 - RFE: Nicer exit message when updateinfo is bad in repo.
Summary: RFE: Nicer exit message when updateinfo is bad in repo.
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 9
Hardware: All
OS: Linux
medium
urgent
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-11-17 12:30 UTC by Frank Ch. Eigler
Modified: 2014-01-21 23:06 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-21 18:03:53 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Frank Ch. Eigler 2008-11-17 12:30:21 UTC
Description of problem:
yum --security list-updates crashes

Version-Release number of selected component (if applicable):
yum-utils-1.1.17-1.fc9.noarch
yum-security-1.1.17-1.fc9.noarch
yum-3.2.20-3.fc9.2.noarch

How reproducible:
always

Steps to Reproduce:
# yum --security list-updates
  
Actual results:
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 104, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 339, in doCommands
    self._getTs(needTsRemove)
  File "/usr/lib/python2.5/site-packages/yum/depsolve.py", line 101, in _getTs
    self._getTsInfo(remove_only)
  File "/usr/lib/python2.5/site-packages/yum/depsolve.py", line 112, in _getTsInfo
    pkgSack = self.pkgSack
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 592, in <lambda>
    pkgSack = property(fget=lambda self: self._getSacks(),
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 447, in _getSacks
    self.plugins.run('exclude')
  File "/usr/lib/python2.5/site-packages/yum/plugins.py", line 176, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/security.py", line 488, in exclude_hook
    md_info = ysp_gen_metadata(conduit.getRepos().listEnabled())
  File "/usr/lib/yum-plugins/security.py", line 76, in ysp_gen_metadata
    md_info.add(repo)
  File "/usr/lib/python2.5/site-packages/yum/update_md.py", line 369, in add
    un = UpdateNotice(elem)
  File "/usr/lib/python2.5/site-packages/yum/update_md.py", line 70, in __init__
    self._parse(elem)
  File "/usr/lib/python2.5/site-packages/yum/update_md.py", line 147, in _parse
    raise UpdateNoticeException("No id element found")
yum.update_md.UpdateNoticeException: No id element found


Expected results:
pictures of happy bunnies, frolicking amongst balloons in the sunshine

Comment 1 Tim Lauridsen 2008-11-17 12:43:44 UTC
I have this bug reported against yumex too.
https://bugzilla.redhat.com/show_bug.cgi?id=471731

Comment 2 James Antill 2008-11-17 15:46:29 UTC
  File "/usr/lib/python2.5/site-packages/yum/update_md.py", line 70, in
__init__
    self._parse(elem)
  File "/usr/lib/python2.5/site-packages/yum/update_md.py", line 147, in _parse
    raise UpdateNoticeException("No id element found")
yum.update_md.UpdateNoticeException: No id element found

...this isn't anything to do with yum-security ... the yum parser is failing. And this is the code:

                if child.tag == 'id':
                    if not child.text:
                        raise UpdateNoticeException("No id element found")

...so I'm tempted to say it's a rel-eng problem on whatever repo. is generating updates with an empty id.

Comment 3 Luke Macken 2008-11-17 18:13:36 UTC
This was caused by a race condition in the push process.  kernel-2.6.27.5-37.fc9 was obsoleted mid-push, after it was tagged with dist-f9-updates, but before it was able to assign an update ID.  Therefore, this update was injected into the updateinfo with an empty id tag.

I have since fixed the update, and fresh repositories are mashing as we speak.

I filed a ticket against bodhi to fix this race condition:
https://fedorahosted.org/bodhi/ticket/265

Comment 4 Frank Ch. Eigler 2008-11-17 19:01:21 UTC
(In reply to comment #2)
> ...this isn't anything to do with yum-security ... the yum parser is failing.
> And this is the code:
> [...]
> ...so I'm tempted to say it's a rel-eng problem on whatever repo. is generating
> updates with an empty id.

IMO it is unacceptable for the software to fail this way merely because of
some network data problem.  Let it skip the troubling xml and emit a warning,
with a well-placed try: / except:.

Comment 5 James Antill 2008-11-17 19:19:38 UTC
 I disagree ... failing silently (by skipping the repodata) is a bad idea suddently yum --security will silently not update security errata (because the data is bad so it skips everything).
 I guess we could catch it at the top level of yum, so there is no backtrace, but I also wouldn't classify this as a normal failure condition.

Comment 6 Luke Macken 2008-11-19 15:48:47 UTC
The fixed repos should have hit our mirrors a couple of days ago.

Comment 7 seth vidal 2009-01-21 18:03:53 UTC
all in all it is fixed. As we make adjustments to the security pluging and update_md in general we'll make it better.


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