Bug 663378

Summary: yum --changelog update traceback
Product: Red Hat Enterprise Linux 6 Reporter: David Kovalsky <dkovalsk>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED ERRATA QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: high    
Version: 6.0CC: benl, ksrot, tcapek
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.29-5.el6 Doc Type: Bug Fix
Doc Text:
Running "yum --changelog update" caused yum to terminate with a traceback. With this update, an informative error message is given instead.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:34:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Kovalsky 2010-12-15 15:38:33 UTC
Running yum --changelog update on a RHEL6 system results in a traceback.

[root@kovinek ~]# yum --changelog update
Loaded plugins: auto-update-debuginfo, changelog, refresh-packagekit, rhnplugin
Found 23 installed debuginfo package(s)
Enabling epel-debuginfo: Extra Packages for Enterprise Linux 6 - x86_64 - Debug
Reading repository metadata in from local files
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package NetworkManager.x86_64 1:0.8.1-5.el6_0.1 set to be updated
---> Package NetworkManager-glib.x86_64 1:0.8.1-5.el6_0.1 set to be updated
---> Package NetworkManager-gnome.x86_64 1:0.8.1-5.el6_0.1 set to be updated
---> Package bzip2.x86_64 0:1.0.5-7.el6_0 set to be updated
---> Package bzip2-libs.x86_64 0:1.0.5-7.el6_0 set to be updated
---> Package cups.x86_64 1:1.4.2-35.el6_0.1 set to be updated
---> Package cups-libs.x86_64 1:1.4.2-35.el6_0.1 set to be updated
---> Package cvs.x86_64 0:1.11.23-11.el6_0.1 set to be updated
---> Package device-mapper.x86_64 0:1.02.53-8.el6_0.2 set to be updated
---> Package device-mapper-event.x86_64 0:1.02.53-8.el6_0.2 set to be updated
---> Package device-mapper-event-libs.x86_64 0:1.02.53-8.el6_0.2 set to be updated
---> Package device-mapper-libs.x86_64 0:1.02.53-8.el6_0.2 set to be updated
---> Package dhclient.x86_64 12:4.1.1-12.P1.el6_0.1 set to be updated
---> Package dracut.noarch 0:004-33.el6_0 set to be updated
---> Package dracut-kernel.noarch 0:004-33.el6_0 set to be updated
---> Package firefox.x86_64 0:3.6.12-1.el6_0 set to be updated
---> Package freetype.x86_64 0:2.3.11-6.el6_0.2 set to be updated
---> Package glibc.x86_64 0:2.12-1.7.el6_0.3 set to be updated
---> Package glibc-common.x86_64 0:2.12-1.7.el6_0.3 set to be updated
---> Package java-1.6.0-openjdk.x86_64 1:1.6.0.0-1.31.b17.el6_0 set to be updated
---> Package kernel.x86_64 0:2.6.32-71.7.1.el6 set to be installed
---> Package kernel-firmware.noarch 0:2.6.32-71.7.1.el6 set to be updated
---> Package krb5-libs.x86_64 0:1.8.2-3.el6_0.3 set to be updated
---> Package krb5-workstation.x86_64 0:1.8.2-3.el6_0.3 set to be updated
---> Package libcap-ng.x86_64 0:0.6.4-3.el6_0.1 set to be updated
---> Package libcollection.x86_64 0:0.5.0-28.el6_0.2 set to be updated
---> Package libdhash.x86_64 0:0.4.0-28.el6_0.2 set to be updated
---> Package libini_config.x86_64 0:0.5.1-28.el6_0.2 set to be updated
---> Package libpurple.x86_64 0:2.6.6-6.el6_0 set to be updated
---> Package libsmbclient.x86_64 0:3.5.4-68.el6_0.1 set to be updated
---> Package lvm2.x86_64 0:2.02.72-8.el6_0.2 set to be updated
---> Package lvm2-libs.x86_64 0:2.02.72-8.el6_0.2 set to be updated
---> Package net-snmp.x86_64 1:5.5-27.el6_0.1 set to be updated
---> Package net-snmp-libs.x86_64 1:5.5-27.el6_0.1 set to be updated
---> Package nscd.x86_64 0:2.12-1.7.el6_0.3 set to be updated
---> Package nss.x86_64 0:3.12.8-1.el6_0 set to be updated
---> Package nss-softokn.x86_64 0:3.12.8-1.el6_0 set to be updated
---> Package nss-softokn-freebl.x86_64 0:3.12.8-1.el6_0 set to be updated
---> Package nss-sysinit.x86_64 0:3.12.8-1.el6_0 set to be updated
---> Package nss-util.x86_64 0:3.12.8-1.el6_0 set to be updated
---> Package openssl.x86_64 0:1.0.0-4.el6_0.1 set to be updated
---> Package pam.x86_64 0:1.1.1-4.el6_0.1 set to be updated
---> Package pidgin.x86_64 0:2.6.6-6.el6_0 set to be updated
---> Package pixman.x86_64 0:0.18.4-1.el6_0.1 set to be updated
---> Package poppler.x86_64 0:0.12.4-3.el6_0.1 set to be updated
---> Package poppler-glib.x86_64 0:0.12.4-3.el6_0.1 set to be updated
---> Package poppler-utils.x86_64 0:0.12.4-3.el6_0.1 set to be updated
---> Package postgresql-libs.x86_64 0:8.4.5-1.el6_0.2 set to be updated
---> Package python-gudev.x86_64 0:147.1-4.el6_0.1 set to be updated
---> Package samba-client.x86_64 0:3.5.4-68.el6_0.1 set to be updated
---> Package samba-common.x86_64 0:3.5.4-68.el6_0.1 set to be updated
---> Package samba-winbind-clients.x86_64 0:3.5.4-68.el6_0.1 set to be updated
---> Package selinux-policy.noarch 0:3.7.19-54.el6_0.3 set to be updated
---> Package selinux-policy-targeted.noarch 0:3.7.19-54.el6_0.3 set to be updated
---> Package sssd.x86_64 0:1.2.1-28.el6_0.2 set to be updated
---> Package sssd-client.x86_64 0:1.2.1-28.el6_0.2 set to be updated
---> Package sysstat.x86_64 0:9.0.4-12.el6_0.1 set to be updated
---> Package systemtap-runtime.x86_64 0:1.2-11.el6_0 set to be updated
---> Package upstart.x86_64 0:0.6.5-6.1.el6_0.1 set to be updated
---> Package xorg-x11-drv-qxl.x86_64 0:0.0.12-2.1.el6_0.1 set to be updated
---> Package xulrunner.x86_64 0:1.9.2.12-1.el6_0 set to be updated
--> Finished Dependency Resolution
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 254, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 150, in main
    (result, resultmsgs) = base.buildTransaction() 
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 872, in buildTransaction
    self.plugins.run('postresolve', rescode=rescode, restring=restring)
  File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 179, in run
    func(conduitcls(self, self.base, conf, **kwargs))
  File "/usr/lib/yum-plugins/changelog.py", line 283, in postresolve_hook
    mdi = UpdateMetadata(repos=list(repos))
  File "/usr/lib/python2.6/site-packages/yum/update_md.py", line 312, in __init__
    self.add(repo)
  File "/usr/lib/python2.6/site-packages/yum/update_md.py", line 398, in add
    for event, elem in iterparse(infile):
  File "<string>", line 64, in __iter__
SyntaxError: mismatched tag: line 129, column 2


Updating against a satellite with RHN enabled, as well as an HTTP repo of RHEL6 files. Running without '--changelog' seems to do the trick, but anyway - traceback is not nice.

[root@kovinek ~]# rpm -q yum
yum-3.2.27-14.el6_0.1.noarch

Comment 2 James Antill 2010-12-15 16:06:21 UTC
  File "/usr/lib/python2.6/site-packages/yum/update_md.py", line 312, in
__init__
    self.add(repo)
  File "/usr/lib/python2.6/site-packages/yum/update_md.py", line 398, in add
    for event, elem in iterparse(infile):
  File "<string>", line 64, in __iter__
SyntaxError: mismatched tag: line 129, column 2

...this means that the updateinfo for the repo. is not XML. We already do:

        for event, elem in iterparse(infile):
            if elem.tag == 'update':
                try:
                    un = UpdateNotice(elem)
                except UpdateNoticeException, e:
                    print >> sys.stderr, "An update notice is broken, skipping."
                    # what else should we do?
                    continue
                self.add_notice(un)

...but we could certainly move that out to cover the iterparse too. --changelog/--security/etc. still won't _work_ (because that data is broken), but it won't traceback.

Comment 3 David Kovalsky 2010-12-15 16:17:04 UTC
Hi James,
thanks for the quick reply. 

It'd be nice to have such a solution. Printing something like "WARNING: changelog data won't be available, format is wrong" would clearly points users the right direction.

Comment 9 Tomas Capek 2011-05-17 12:05:09 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Running "yum --changelog update" caused yum to terminate with a traceback. With this update, an informative error message is given instead.

Comment 10 errata-xmlrpc 2011-05-19 13:34:04 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0602.html