Actions
Issue #3787
closedUnhashable type: list while recursively copying rpm content categories
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.17.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 39
Quarter:
Description
While testing the pulp_rpm PR 1122 for Issue #3715 ran into following traceback:
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) Exception from importer [yum_importer] while importing units into repository [fo
o]
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) Traceback (most recent call last):
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp/server/pulp/server/managers/repo/unit_association
.py", line 273, in associate_from_repo
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) units=transfer_units)
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/import
er.py", line 58, in import_units
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) return associate.associate(source_repo, dest_repo, import_conduit, config, u
nits)
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/associ
ate.py", line 88, in associate
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) associate(source_repo, dest_repo, import_conduit, config, group_units))
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.managers.repo.unit_association:ERROR: [5e075c5f] (8750-23936) TypeError: unhashable type: 'list'
Jun 25 22:04:08 pulp2F28 pulp[8750]: pulp.server.async.tasks:INFO: [5e075c5f] Task failed : [5e075c5f-f93f-4fd9-a9db-38c70f430007]
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) Task pulp.server.managers.repo.unit_association.associate_from_repo[5e075c5f-f93f-4fd9-a9db-38c70f430007]
raised unexpected: TypeError("unhashable type: 'list'",)
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) Traceback (most recent call last):
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 367, in trace_task
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) R = retval = fun(*args, **kwargs)
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp/server/pulp/server/async/tasks.py", line 529, in __call__
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) return super(Task, self).__call__(*args, **kwargs)
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp/server/pulp/server/async/tasks.py", line 107, in __call__
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) return super(PulpTask, self).__call__(*args, **kwargs)
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) File "/usr/lib/python2.7/site-packages/celery/app/trace.py", line 622, in __protected_call__
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) return self.run(*args, **kwargs)
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) File "/home/milan/devel/pulp/server/pulp/server/managers/repo/unit_association.py", line 291, in associa
te_from_repo
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) raise (e, None, sys.exc_info()[2])
Jun 25 22:04:08 pulp2F28 pulp[8750]: celery.app.trace:ERROR: [5e075c5f] (8750-23936) TypeError: unhashable type: 'list'
In the offending line, the associate
function is called recursively with found content category group rpm units but returns the whole tuple instead of just the list of associated units into the set
call, causing the traceback.
Updated by milan almost 5 years ago
- Status changed from NEW to POST
see https://github.com/pulp/pulp_rpm/pull/1124 for a possible patch
Updated by CodeHeeler almost 5 years ago
- Triaged changed from No to Yes
- Sprint set to Sprint 39
Added by dparalen almost 5 years ago
Updated by Anonymous over 4 years ago
- Status changed from POST to MODIFIED
Applied in changeset 898eb8977ff798900dec9d7cd8e38b5f4a4693cb.
Updated by dkliban@redhat.com over 4 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
- Platform Release set to 2.17.0
Actions
Amend the recursive associate call
The associate recursive call is broken in the content category code path; the return value is a tuple containing the list of associated and the list of failed units, that can't be used directly when updating the associated_units set.
The patch corrects this by using the tuple items to extend the associated_units and failed_units sets. It also removes the set->list conversion at the return statements for easier handling of the recursive call as well as for performance benefits.
Fixes: #3787 https://pulp.plan.io/issues/3787