Red Hat Bugzilla – Bug 241182
pirut crashes on empty group file
Last modified: 2014-01-21 17:58:11 EST
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
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. touch /path/to/repository/i386/base/emptygroups.xml
2. createrepo -c /path/to/repocache/i386 -g base/emptygroups.xml -q
Component: Software Manager
Summary: TB27ac5246 <string>:68:__iter__:SyntaxError: no element found: line 1,
Traceback (most recent call last):
File "/usr/sbin/pirut", line 453, in ?
File "/usr/sbin/pirut", line 449, in main
File "/usr/sbin/pirut", line 358, in run
File "/usr/sbin/pirut", line 373, in doRefresh
File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 151, in reposSetup
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 408, in doGroupSetup
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>
silently ignore empty file.
Additional reproducer notes.....
On client clean the metadata-caches:
# yum clean all
Then run pup / pirut:
# pup ----> crash
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
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
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.