Issue #3524
closedChangeset exception during sync
Description
In pulp_ansible, we have role versions and we're seeing the error below when the code hits dupe artifacts. The problem is that the artifact_q filter is empty:
https://github.com/pulp/pulp/blob/3.0-dev/plugin/pulpcore/plugin/changeset/model.py#L376-L381
I think this doesn't happen for pulp_file because we're able to set the digests on the artifacts:
https://github.com/pulp/pulp_file/blob/master/pulp_file/app/tasks/synchronizing.py#L161
This digest info comes from the metadata and in pulp_ansible's metadata, we don't have any digest info for artifacts.
Mar 23 19:12:00 pulp3.dev celery[2413]: Traceback (most recent call last):
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/celery/app/trace.py", line 374, in trace_task
Mar 23 19:12:00 pulp3.dev celery[2413]: R = retval = fun(*args, **kwargs)
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/pulpcore/pulpcore/tasking/tasks.py", line 273, in __call__
Mar 23 19:12:00 pulp3.dev celery[2413]: return super().__call__(*args, **kwargs)
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/celery/app/trace.py", line 629, in __protected_call__
Mar 23 19:12:00 pulp3.dev celery[2413]: return self.run(*args, **kwargs)
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp_ansible/pulp_ansible/app/tasks/synchronizing.py", line 80, in synchronize
Mar 23 19:12:00 pulp3.dev celery[2413]: for report in changeset.apply():
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/changeset/main.py", line 196, in apply
Mar 23 19:12:00 pulp3.dev celery[2413]: for report in itertools.chain(self._apply_additions(), self._apply_removals()):
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/changeset/main.py", line 151, in _apply_additions
Mar 23 19:12:00 pulp3.dev celery[2413]: content.settle()
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/changeset/model.py", line 189, in settle
Mar 23 19:12:00 pulp3.dev celery[2413]: self.save()
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/changeset/model.py", line 210, in save
Mar 23 19:12:00 pulp3.dev celery[2413]: artifact.save()
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/devel/pulp/plugin/pulpcore/plugin/changeset/model.py", line 381, in save
Mar 23 19:12:00 pulp3.dev celery[2413]: self._stored_model = Artifact.objects.get(q)
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/manager.py", line 85, in manager_method
Mar 23 19:12:00 pulp3.dev celery[2413]: return getattr(self.get_queryset(), name)(*args, **kwargs)
Mar 23 19:12:00 pulp3.dev celery[2413]: File "/home/vagrant/.virtualenvs/pulp/lib64/python3.5/site-packages/django/db/models/query.py", line 384, in get
Mar 23 19:12:00 pulp3.dev celery[2413]: (self.model._meta.object_name, num)
Mar 23 19:12:00 pulp3.dev celery[2413]: pulpcore.app.models.content.MultipleObjectsReturned: get() returned more than one Artifact -- it returned 70!
Updated by daviddavis over 6 years ago
- Description updated (diff)
FYI, this is a blocker for pulp_ansible and probably other plugins as well.
Added by jortel@redhat.com over 6 years ago
Added by jortel@redhat.com over 6 years ago
Revision 0e55d183 | View on GitHub
Prevent query matching all content/artifact when not criteria included in the Q. closes #3524
Updated by jortel@redhat.com over 6 years ago
- Status changed from NEW to POST
- Assignee set to jortel@redhat.com
- Sprint set to Sprint 35
Updated by jortel@redhat.com over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulp|0e55d18307c2f4c66d5c98fb991841b44dc19ccb.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Prevent query matching all content/artifact when not criteria included in the Q. closes #3524