Issue #2504
closederrata applicability fails if errata packagelist doesn't exist
Description
If you sync a repo with an errata that does not have a package list such as this one here:
https://github.com/Katello/runcible/blob/master/test/fixtures/repositories/zoo5/updateinfo.xml#L3-L9
and then try to generate applicability for a consumer, you will get an error:
"traceback"=>"Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 240, in trace_task
R = retval = fun(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 488, in __call__
return super(Task, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 103, in __call__
return super(PulpTask, self).__call__(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 437, in __protected_call__
return self.run(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/consumer/applicability.py", line 107, in regenerate_applicability_for_consumers
manager.regenerate_applicability(profile_hash, content_type, profile_id, repo_id)
File "/usr/lib/python2.7/site-packages/pulp/server/managers/consumer/applicability.py", line 257, in regenerate_applicability
profiler_conduit)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/profilers/yum.py", line 65, in calculate_applicable_units
bound_repo_id, config, conduit)}
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/profilers/yum.py", line 212, in _calculate_applicable_units
unit, profile_lookup_table, available_rpm_nevras)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/profilers/yum.py", line 314, in _is_errata_applicable
errata_rpms = YumProfiler._get_rpms_from_errata(errata)
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/profilers/yum.py", line 292, in _get_rpms_from_errata
for pkgs in errata.metadata['pkglist']:
TypeError: 'NoneType' object is not iterable
This used to work (on at least 2.8.7), but no longer does on 2.9.3 an newer.
Updated by jsherril@redhat.com over 7 years ago
I wouldn't necessarily disagree if its argued that this is an invalid errata, however it shouldn't break applicability generation for the entire repo.
I could see arguments being made that it should be ignored or skipped during sync.
Updated by bizhang over 7 years ago
- Priority changed from Normal to High
- Sprint/Milestone set to 31
- Severity changed from 2. Medium to 3. High
- Triaged changed from No to Yes
Updated by jortel@redhat.com over 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Updated by jortel@redhat.com over 7 years ago
This works for me on f23 using pulp 2.11 and the fixtures repository noted in the description. The errata.metadata['pkglist'] is [] instead of None. I will continue to investigate.
Updated by jortel@redhat.com over 7 years ago
- Status changed from ASSIGNED to CLOSED - WORKSFORME
This works for me. After discussion with jsherril (reporter) who is also unable to reproduce, we decided to close and reopen should the problem re-appear.
Updated by bmbouter almost 4 years ago
- Category deleted (
14)
We are removing the 'API' category per open floor discussion June 16, 2020.