Project

Profile

Help

Backport #9195

closed

Backport #8713 "Pulp 3 to Pulp 2 sync fails if comps.xml has a group with an empty packagelist" to 3.11.z

Added by ttereshc over 3 years ago. Updated about 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
Triaged:
No
Sprint Candidate:
No
Tags:
Katello
Sprint:
Quarter:

Description

To reproduce:

  • Pulp 3: sync/publish/distribute RHEL8 Appstream (which has a group "conflicts-appstream" which has an empty packagelist)
  • Pulp 2: sync from the repo above, observe the following error
 'NoneType' object has no attribute 'findall'
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 321, in run
     group.GROUP_TAG)
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 950, in get_comps_file_units
     self.save_fileless_units(group_file_handle, tag, process_func, mutable_type=True)
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/sync.py", line 1006, in save_fileless_units
     for model in package_info_generator:
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/repomd/packages.py", line 64, in package_list_generator
     package_info = process_func(element)
   File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/repomd/group.py", line 32, in process_group_element
     packagelist.findall('packagereq'))
 AttributeError: 'NoneType' object has no attribute 'findall'
INFO: [ac1cd020] Task failed : [ac1cd020-c06c-4d53-ac08-1adbab8c41b1]
 Task pulp.server.managers.repo.sync.sync[ac1cd020-c06c-4d53-ac08-1adbab8c41b1] raised unexpected: PulpExecutionException('Importer indicated a failed response',)
 Traceback (most recent call last):
   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
     R = retval = fun(*args, **kwargs) 
   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 688, in __call__
     return super(Task, self).__call__(*args, **kwargs)
   File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 110, in __call__
     return super(PulpTask, self).__call__(*args, **kwargs)
   File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
     return self.run(*args, **kwargs)
   File "/usr/lib/python2.7/site-packages/pulp/server/controllers/repository.py", line 860, in sync
     raise pulp_exceptions.PulpExecutionException(_('Importer indicated a failed response'))
 PulpExecutionException: Importer indicated a failed response

Pulp 3 uses libcomps to generate a comps.xml file and it doesn't generate empty XML elements.
Pulp 2 expects packagelist to be always present, even if empty.
It also seems to be a mandatory however it is according to the unofficial spec.


Related issues

Copied from RPM Support - Issue #8713: Pulp 3 to Pulp 2 sync fails if comps.xml has a group with an empty packagelistCLOSED - CURRENTRELEASEttereshcActions

Also available in: Atom PDF