Bug 241182 - pirut crashes on empty group file
Summary: pirut crashes on empty group file
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: yum   
(Show other bugs)
Version: 5.0
Hardware: All Linux
medium
medium
Target Milestone: ---
: ---
Assignee: James Antill
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-05-24 11:47 UTC by Martin Poole
Modified: 2018-10-19 23:32 UTC (History)
3 users (show)

Fixed In Version: RHBA-2008-0388
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 14:20:34 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2008:0388 normal SHIPPED_LIVE yum bug fix update 2008-05-20 16:41:14 UTC

Description Martin Poole 2007-05-24 11:47:48 UTC
Description of problem:

if pirut meets an empty group file (0 bytes) it crashes.
Whilst an empty file is not strictly xml, it is not useful to have the program
crash.

Version-Release number of selected component (if applicable):

pirut-1.2.10-1.el5

How reproducible:

always

Steps to Reproduce:
1. touch /path/to/repository/i386/base/emptygroups.xml
2. createrepo -c /path/to/repocache/i386 -g base/emptygroups.xml -q
/path/to/repository/i386/
3.
  
Actual results:

Component: Software Manager
Summary: TB27ac5246 <string>:68:__iter__:SyntaxError: no element found: line 1,
column 0

Traceback (most recent call last):
 File "/usr/sbin/pirut", line 453, in ?
   main()
 File "/usr/sbin/pirut", line 449, in main
   pm.run()
 File "/usr/sbin/pirut", line 358, in run
   self.doRefresh()
 File "/usr/sbin/pirut", line 373, in doRefresh
   self.reposSetup(pbar)
 File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 151, in reposSetup
   self.doGroupSetup()
 File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 408, in doGroupSetup
   self.comps.add(groupfile)
 File "/usr/lib/python2.4/site-packages/yum/comps.py", line 337, in add
   for event, elem in parser:
 File "<string>", line 68, in __iter__
SyntaxError: no element found: line 1, column 0

Local variables in innermost frame:
p: <XMLParser object at 0xa88f170>
self: <iterparse object at 0xa8b534c>
b: <TreeBuilder object at 0xa855560>
data:
events: []


Expected results:

silently ignore empty file.

Additional info:

Comment 1 Martin Poole 2007-05-24 11:49:21 UTC
Additional reproducer notes.....

On client clean the metadata-caches:
       # yum clean all
Then run pup / pirut:
       # pup ----> crash
Yum works:
       # yum

Comment 2 Jeremy Katz 2007-05-29 18:08:17 UTC
I suspect 'yum groupinstall' will fail also...

The right thing to do here is to catch the empty parser in the yum comps parser
rather than adding handling in every caller of the yum API.  Should be
straight-forward enough to do

Comment 4 RHEL Product and Program Management 2007-10-16 03:59:06 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 errata-xmlrpc 2008-05-21 14:20:34 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 the 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-2008-0388.html



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