Bug 471873 - RFE: Nicer exit message when updateinfo is bad in repo.
RFE: Nicer exit message when updateinfo is bad in repo.
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
9
All Linux
medium Severity urgent
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-11-17 07:30 EST by Frank Ch. Eigler
Modified: 2014-01-21 18:06 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-21 13:03:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Frank Ch. Eigler 2008-11-17 07:30:21 EST
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 07:43:44 EST
I have this bug reported against yumex too.
https://bugzilla.redhat.com/show_bug.cgi?id=471731
Comment 2 James Antill 2008-11-17 10:46:29 EST
  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 13:13:36 EST
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 14:01:21 EST
(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 14:19:38 EST
 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 10:48:47 EST
The fixed repos should have hit our mirrors a couple of days ago.
Comment 7 seth vidal 2009-01-21 13:03:53 EST
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.