Problem:
Syncing yum repos to the proxies always fails to complete if it can’t process the comps.xml properly.
It is related to the problem:
CentOS 8 BaseOS thinks it is AppStream
Because the AppStream’s repo data ends up in the wrong place, the replication doesn’t find it and pulp fails.
Expected outcome:
obviously the solution is to handle the variants properly.
But pulp yum importer needs to be able to handle unexpected cases (like packagelist is None) rather than “crashing”…because then is also doesn’t complete the remaining sync steps to were meant to be executed after this
Foreman and Proxy versions:
foreman 2.3.2
katello 3.18.1
Foreman and Proxy plugin versions:
pulp-rpm-plugins-2.21.5-1.el7.noarch
Distribution and version:
centos 7
Other relevant data:
"progress_report"=>
{"yum_importer"=>
{"content"=>
{"size_total"=>0,
"items_left"=>0,
"items_total"=>0,
"state"=>"FAILED",
"size_left"=>0,
"details"=>
{"rpm_total"=>0, "rpm_done"=>0, "drpm_total"=>0, "drpm_done"=>0},
"error"=>"'NoneType' object has no attribute 'findall'",
"error_details"=>[]},
"comps"=>{"state"=>"NOT_STARTED"},
"purge_duplicates"=>{"state"=>"NOT_STARTED"},
"distribution"=>
{"items_total"=>0,
"state"=>"NOT_STARTED",
"error_details"=>[],
"items_left"=>0},
"modules"=>{"state"=>"NOT_STARTED"},
"errata"=>{"state"=>"NOT_STARTED"},
"metadata"=>{"state"=>"FINISHED"}}},
"queue"=>"reserved_resource_worker-1@m21vmfrm.dq2",
"state"=>"error",
"worker_name"=>"reserved_resource_worker-1@m21vmfrm",
"result"=>nil,
"error"=>
{"code"=>"PLP0000",
"data"=>{},
"description"=>"Importer indicated a failed response",
"sub_errors"=>[]},
"_id"=>{"$oid"=>"6037f739555c2f6581c89f8f"},
"id"=>"6037f739555c2f6581c89f8f"}],
“poll_attempts”=>{“total”=>32, “failed”=>1}}
the issue is in:
/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/repomd/group.py
def process_group_element(repo_id, element):
"""
Process one XML block from comps.xml and return a models.PackageGroup instance
:param repo_id: unique ID for the destination repository
:type repo_id basestring
:param element: object representing one "group" block from the XML file
:type element: xml.etree.ElementTree.Element
:return: models.PackageGroup instance for the XML block
:rtype: pulp_rpm.plugins.db.models.PackageGroup
"""
packagelist = element.find('packagelist')
conditional, default, mandatory, optional = _parse_packagelist(
packagelist.findall('packagereq'))