{"id":653,"date":"2016-06-25T03:11:47","date_gmt":"2016-06-24T20:11:47","guid":{"rendered":"http:\/\/blog.trichev.com\/?p=653"},"modified":"2017-08-10T09:12:03","modified_gmt":"2017-08-10T02:12:03","slug":"spacewalk-2-2-epel7-issues","status":"publish","type":"post","link":"https:\/\/trichev.com\/blog\/2016\/06\/25\/spacewalk-2-2-epel7-issues\/","title":{"rendered":"Spacewalk 2.2 EPEL7 issues"},"content":{"rendered":"<p>1)<br \/>\nGot the issue on Centos 6.6 x86_64 with Spacewalk2.2 when tried to do client Centos 7 with EPEL installation &#8211; &#8220;\/tmp\/yum.cache\/epel7-centos7-x86_64\/comps.xml: not well-formed (invalid token): line 1, column 0&#8221;.<br \/>\nThis 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.<br \/>\nI&#8217;ve found solution <a href=\"https:\/\/marc.info\/?l=spacewalk-list&amp;m=142387145808334&amp;w=3\">here<\/a> and <a href=\"https:\/\/github.com\/spacewalkproject\/spacewalk\/commit\/76883065ff72449726adc82d081ae681f2a5bb59\">here<\/a>.<\/p>\n<p>So, the idea is to find, first, where spacewalk store python files that I have to update to support xz:<br \/>\nfind \/ -name &#8216;reposync.py&#8217; or find \/ -name &#8216;fileutils.py&#8217;<\/p>\n<p>For me it&#8217;s here:<br \/>\n\/usr\/lib\/python2.6\/site-packages\/spacewalk\/satellite_tools\/reposync.py<br \/>\n\/usr\/lib\/python2.6\/site-packages\/spacewalk\/common\/fileutils.py<\/p>\n<p>Update the files:<br \/>\n<code><br \/>\ncommon\/fileutils.py<br \/>\n@@ -17,6 +17,7 @@<br \/>\nimport sys<br \/>\nimport bz2<br \/>\nimport gzip<br \/>\n+import lzma<br \/>\nimport pwd<br \/>\nimport grp<br \/>\nimport types<br \/>\n@@ -478,6 +479,8 @@ def decompress_open(filename, mode='r'):<br \/>\nfile_obj = gzip.open(filename, mode)<br \/>\nelif filename.endswith('.bz2'):<br \/>\nfile_obj = bz2.BZ2File(filename, mode)<br \/>\n+ elif filename.endswith('.xz'):<br \/>\n+ file_obj = lzma.LZMAFile(filename, mode)<br \/>\nelse:<br \/>\nfile_obj = open(filename, mode)<br \/>\nreturn file_obj<\/p>\n<p>satellite_tools\/reposync.py<br \/>\n@@ -248,7 +248,7 @@ def import_groups(self, plug, url):<br \/>\nos.makedirs(absdir)<br \/>\nrelativepath = os.path.join(relativedir, basename)<br \/>\nabspath = os.path.join(absdir, basename)<br \/>\n- for suffix in ['.gz', '.bz']:<br \/>\n+ for suffix in ['.gz', '.bz', '.xz']:<br \/>\nif basename.endswith(suffix):<br \/>\nabspath = abspath.rstrip(suffix)<br \/>\nrelativepath = relativepath.rstrip(suffix)<br \/>\n<\/code><br \/>\n2)<br \/>\nrhn-client-tools dependencies:<\/p>\n<p>rhn-client-tools-2.2.6-1.el7.noarch requires python-dmidecode<br \/>\nrhn-client-tools-2.2.6-1.el7.noarch requires python-gudev<br \/>\nrhn-client-tools-2.2.6-1.el7.noarch requires python-hwdata<\/p>\n<p>This was caused by using the CentOS-7-x86_64-DVD-1511.iso iso as a kickstart tree&#8230;<br \/>\nResolution: Prepare the centos7 tree using the CentOS-7-x86_64-Everything-1511.iso media:<\/p>\n<p>mkdir \/var\/satellite\/rhn\/kickstart\/2\/centos-7-x86_64-base<br \/>\nmount -o loop \/var\/CentOS-7-x86_64-Everything-1511.iso \/mnt\/<br \/>\nrsync -arv \/mnt\/ \/var\/satellite\/rhn\/kickstart\/2\/centos-7-x86_64-base\/<br \/>\nrm -f \/var\/satellite\/rhn\/kickstart\/2\/centos-7-x86_64-base\/Packages\/*.rpm<\/p>\n<p>Links:<\/p>\n<p><a href=\"https:\/\/marc.info\/?l=spacewalk-list&amp;m=142387145808334&amp;w=3\">https:\/\/marc.info\/?l=spacewalk-list&amp;m=142387145808334&amp;w=3<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/spacewalkproject\/spacewalk\/commit\/76883065ff72449726adc82d081ae681f2a5bb59\">https:\/\/github.com\/spacewalkproject\/spacewalk\/commit\/76883065ff72449726adc82d081ae681f2a5bb59<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) Got the issue on Centos 6.6 x86_64 with Spacewalk2.2 when tried to do client Centos 7 with EPEL installation &#8211; &#8220;\/tmp\/yum.cache\/epel7-centos7-x86_64\/comps.xml: not well-formed (invalid token): line 1, column 0&#8221;. 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 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[231],"tags":[32,86,205,28,14,11],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/653"}],"collection":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/comments?post=653"}],"version-history":[{"count":5,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/653\/revisions"}],"predecessor-version":[{"id":658,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/posts\/653\/revisions\/658"}],"wp:attachment":[{"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/media?parent=653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/categories?post=653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trichev.com\/blog\/wp-json\/wp\/v2\/tags?post=653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}