Issue #3875
closedTraceback when RPM import fails signature check
Description
Let's say one does the following:
1. Create an RPM repository, and populate it with unsigned RPMs.
2. Create a second RPM repository. Give it a yum importer that requires signatures. Here's a snippet from the importer: 'config': {'allowed_keys': ['269d9d98'], 'require_signature': True}
.
3. Associate the second repository with the first.
What should happen? No RPMs should be copied from the first repository to the second. What actually happens? Pulp throws a traceback:
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp_rpm.plugins.importers.yum.associate:WARNING: [6431c01b] 2 packages failed signature filter and were not imported.
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) Exception from importer [yum_importer] while importing units into repository [129a0811-8e9a-431e-ab83-31b41dc73c9d]
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) Traceback (most recent call last):
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 273, in associate_from_repo
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) units=transfer_units)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/importer.py", line 58, in import_units
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) return associate.associate(source_repo, dest_repo, import_conduit, config, units)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 73, in associate
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) source_repo, dest_repo, import_conduit, config, solver)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/importers/yum/associate.py", line 231, in copy_rpms
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) for unit in unit_set:
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.managers.repo.unit_association:ERROR: [6431c01b] (1888-99840) RuntimeError: Set changed size during iteration
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: pulp.server.async.tasks:INFO: [6431c01b] Task failed : [6431c01b-228c-4b8c-a428-eaf78fc41a4c]
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) Task pulp.server.managers.repo.unit_association.associate_from_repo[6431c01b-228c-4b8c-a428-eaf78fc41a4c] raised unexpected: RuntimeError('Set changed size during iteration',)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) Traceback (most recent call last):
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) R = retval = fun(*args, **kwargs)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 529, in __call__
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) return super(Task, self).__call__(*args, **kwargs)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp/server/async/tasks.py", line 107, in __call__
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) return super(PulpTask, self).__call__(*args, **kwargs)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) return self.run(*args, **kwargs)
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) File "/usr/lib/python2.7/site-packages/pulp/server/managers/repo/unit_association.py", line 291, in associate_from_repo
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) raise (e, None, sys.exc_info()[2])
Jul 20 12:09:34 rhel-7-pulp-2-17-nightly pulp[1888]: celery.app.trace:ERROR: [6431c01b] (1888-99840) RuntimeError: Set changed size during iteration
Here's a sample definition of the first repository (the source repo with unsigned RPMs):
{'_href': '/pulp/api/v2/repositories/e073e896-fefd-407d-92e5-43eb65bf2fcc/',
'_id': {'$oid': '5b520c0ad76c37046e853a69'},
'_ns': 'repos',
'content_unit_counts': {'drpm': 1, 'rpm': 1, 'srpm': 1},
'description': None,
'display_name': 'e073e896-fefd-407d-92e5-43eb65bf2fcc',
'distributors': [],
'id': 'e073e896-fefd-407d-92e5-43eb65bf2fcc',
'importers': [{'_href': '/pulp/api/v2/repositories/e073e896-fefd-407d-92e5-43eb65bf2fcc/importers/yum_importer/',
'_id': {'$oid': '5b520c0ad76c37046e853a6a'},
'_ns': 'repo_importers',
'config': {},
'id': 'yum_importer',
'importer_type_id': 'yum_importer',
'last_override_config': {},
'last_sync': None,
'last_updated': '2018-07-20T16:21:30Z',
'repo_id': 'e073e896-fefd-407d-92e5-43eb65bf2fcc',
'scratchpad': None}],
'last_unit_added': '2018-07-20T16:21:31Z',
'last_unit_removed': None,
'locally_stored_units': 3,
'notes': {'_repo-type': 'rpm-repo'},
'scratchpad': {},
'total_repository_units': 3}
Here's a sample definition of the second repository (the destination repository that requires signed RPMs):
{'_href': '/pulp/api/v2/repositories/09a9f6c3-dac0-47f8-8538-0d75139cf869/',
'_id': {'$oid': '5b520c0cd76c37046f0f8a94'},
'_ns': 'repos',
'content_unit_counts': {},
'description': None,
'display_name': '09a9f6c3-dac0-47f8-8538-0d75139cf869',
'distributors': [],
'id': '09a9f6c3-dac0-47f8-8538-0d75139cf869',
'importers': [{'_href': '/pulp/api/v2/repositories/09a9f6c3-dac0-47f8-8538-0d75139cf869/importers/yum_importer/',
'_id': {'$oid': '5b520c0cd76c37046f0f8a95'},
'_ns': 'repo_importers',
'config': {'allowed_keys': ['269d9d98'],
'require_signature': True},
'id': 'yum_importer',
'importer_type_id': 'yum_importer',
'last_override_config': {},
'last_sync': None,
'last_updated': '2018-07-20T16:21:32Z',
'repo_id': '09a9f6c3-dac0-47f8-8538-0d75139cf869',
'scratchpad': None}],
'last_unit_added': None,
'last_unit_removed': None,
'locally_stored_units': 0,
'notes': {'_repo-type': 'rpm-repo'},
'scratchpad': {},
'total_repository_units': 0}
To reproduce, run an existing automated test: python -m unittest pulp_2_tests.tests.rpm.api_v2.test_signatures_checked_for_copies
.
This error occurs on Pulp 2 nightly (to-become 2.17). Here's some of the RPMs installed on a test VM:
[root@rhel-7-pulp-2-17-nightly ~]# rpm -qa | grep pulp | sort
pulp-admin-client-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
pulp-deb-admin-extensions-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
pulp-deb-plugins-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
pulp-docker-admin-extensions-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
pulp-docker-plugins-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
pulp-ostree-admin-extensions-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
pulp-ostree-plugins-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
pulp-puppet-admin-extensions-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-puppet-plugins-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-puppet-tools-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
pulp-python-admin-extensions-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
pulp-python-plugins-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
pulp-rpm-admin-extensions-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
pulp-rpm-plugins-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
pulp-selinux-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
pulp-server-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-isodate-0.5.0-4.pulp.el7.noarch
python-pulp-bindings-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-client-lib-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-common-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-deb-common-1.8.0-0.1.alpha.201807190515git4df9825.el7.noarch
python-pulp-docker-common-3.2.0-0.1.alpha.201807190502git4356228.el7.noarch
python-pulp-oid_validation-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-ostree-common-1.4.0-0.1.alpha.201807190504git2c2d534.el7.noarch
python-pulp-puppet-common-2.17.0-0.1.alpha.201807190505git44a02f8.el7.noarch
python-pulp-python-common-2.1.0-0.1.alpha.201807190501gitfabd48c.el7.noarch
python-pulp-repoauth-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
python-pulp-rpm-common-2.17.0-0.1.alpha.201807190507git17a2f5d.el7.noarch
python-pulp-streamer-2.17.0-0.1.alpha.201807190510git37c3b3b.el7.noarch
Updated by Ichimonji10 over 6 years ago
- Subject changed from Traceback when importing RPMs into repo that requires signatures to Traceback when RPM import fails signature check
Updated by dalley over 6 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
Updated by daviddavis over 6 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 40
Added by dalley over 6 years ago
Updated by dalley over 6 years ago
- Status changed from ASSIGNED to POST
Updated by dalley over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset c94780a8176a2dbf4aa37256a1e6073e023d5f05.
Updated by dalley over 6 years ago
- Platform Release changed from master to 2.17.0
Updated by ipanova@redhat.com over 6 years ago
- Status changed from MODIFIED to 5
Updated by ipanova@redhat.com about 6 years ago
- Status changed from 5 to CLOSED - CURRENTRELEASE
Fix iterator modification during iteration
closes #3875 https://pulp.plan.io/issues/3875