Spacewalk 2.2 EPEL7 issues

Got the issue on Centos 6.6 x86_64 with Spacewalk2.2 when tried to do client Centos 7 with EPEL installation – “/tmp/yum.cache/epel7-centos7-x86_64/comps.xml: not well-formed (invalid token): line 1, column 0”.
This is an XML parsing error. The installer is expecting this file to be in XML format. The file is not in XML format, it is XML that has been LZMA/XZ compressed.
I’ve found solution here and here.

So, the idea is to find, first, where spacewalk store python files that I have to update to support xz:
find / -name ‘’ or find / -name ‘’

For me it’s here:

Update the files:

@@ -17,6 +17,7 @@
import sys
import bz2
import gzip
+import lzma
import pwd
import grp
import types
@@ -478,6 +479,8 @@ def decompress_open(filename, mode='r'):
file_obj =, mode)
elif filename.endswith('.bz2'):
file_obj = bz2.BZ2File(filename, mode)
+ elif filename.endswith('.xz'):
+ file_obj = lzma.LZMAFile(filename, mode)
file_obj = open(filename, mode)
return file_obj

@@ -248,7 +248,7 @@ def import_groups(self, plug, url):
relativepath = os.path.join(relativedir, basename)
abspath = os.path.join(absdir, basename)
- for suffix in ['.gz', '.bz']:
+ for suffix in ['.gz', '.bz', '.xz']:
if basename.endswith(suffix):
abspath = abspath.rstrip(suffix)
relativepath = relativepath.rstrip(suffix)

rhn-client-tools dependencies:

rhn-client-tools-2.2.6-1.el7.noarch requires python-dmidecode
rhn-client-tools-2.2.6-1.el7.noarch requires python-gudev
rhn-client-tools-2.2.6-1.el7.noarch requires python-hwdata

This was caused by using the CentOS-7-x86_64-DVD-1511.iso iso as a kickstart tree…
Resolution: Prepare the centos7 tree using the CentOS-7-x86_64-Everything-1511.iso media:

mkdir /var/satellite/rhn/kickstart/2/centos-7-x86_64-base
mount -o loop /var/CentOS-7-x86_64-Everything-1511.iso /mnt/
rsync -arv /mnt/ /var/satellite/rhn/kickstart/2/centos-7-x86_64-base/
rm -f /var/satellite/rhn/kickstart/2/centos-7-x86_64-base/Packages/*.rpm


Leave a comment

You must be logged in to post a comment.