Project

Profile

Help

Issue #7147

AttributeError: 'Package' object has no attribute '_remote_artifact_saver_cas'

Added by ttereshc 5 months ago. Updated about 1 month ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 83
Quarter:

Description

To reproduce, in pulp 2:

Observe the error below.

Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: Traceback (most recent call last):
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 886, in perform_job
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: rv = job.perform()
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 664, in perform
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: self._result = self._execute()
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 670, in _execute
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: return self.func(*self.args, **self.kwargs)
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/tasks/migrate.py", line 127, in migrate_from_pulp2
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: migrate_content(plan)
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/migration.py", line 34, in migrate_content
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: plugin.migrator.migrate_content_to_pulp3()
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/rpm/migrator.py", line 140, in migrate_content_to_pulp3
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: loop.run_until_complete(dm.create())
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: return future.result()
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/content.py", line 84, in create
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: await pipeline
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 225, in create_pipeline
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: await asyncio.gather(*futures)
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py", line 43, in __call__
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: await self.run()
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/artifact_stages.py", line 225, in run
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: RemoteArtifact.objects.bulk_get_or_create(self._needed_remote_artifacts(batch))
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: File "/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/artifact_stages.py", line 264, in _needed_remote_artifacts
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: for content_artifact in d_content.content._remote_artifact_saver_cas:
Jul 15 12:21:58 pulp2-nightly-pulp3-source-centos7.rhgoose.example.com rq[18841]: AttributeError: 'Package' object has no attribute '_remote_artifact_saver_cas'

Observations:

  • there are almost duplicated declarative content units in a batch which only differ by remote (that's expected, if one content unit has multiple LCE in pulp2)
  • If I ignore the exception and proceed to the next d_content here , I see that the even batches are failing and the odd ones are correct. E.g. batch#1 won't raise AttributeError, all content in the batch#2 will, batch#3 will work fine, batch#4 will raise AttributeError.

Related issues

Related to Pulp - Backport #7702: Backport Request: 7147 (AttributeError: 'Package' object has no attribute '_remote_artifact_saver_cas') to 3.7CLOSED - CURRENTRELEASE

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 8dcdcd2d View on GitHub
Added by dkliban@redhat.com about 2 months ago

Handles duplicate content in the stages API.

If the very first Content in a batch has already been prefetched in a previous call to prefetch_related_objects, Django does not set the attribute specified in 'to_attr' when prefetching the rest of the items in the batch. As a result, the '_remote_artifact_saver_cas' attribute is not set on the Content instances and AttributeError is raised when '_remote_artifact_saver_cas' is accessed by the RemoteArtifactSaverStage.

This patch removes any existing '_remote_artifact_saver_cas' attributes on Content before calling into Django's prefetch_related_objects().

fixes: #7147 https://pulp.plan.io/issues/7147

History

#1 Updated by ttereshc 5 months ago

  • Description updated (diff)

#2 Updated by ttereshc 4 months ago

  • Project changed from Migration Plugin to Pulp

#3 Updated by ttereshc 4 months ago

  • Description updated (diff)

#4 Updated by fao89 4 months ago

  • Triaged changed from No to Yes
  • Sprint set to Sprint 78

#5 Updated by rchan 4 months ago

  • Sprint changed from Sprint 78 to Sprint 79

#6 Updated by rchan 3 months ago

  • Sprint changed from Sprint 79 to Sprint 80

#7 Updated by rchan 3 months ago

  • Sprint changed from Sprint 80 to Sprint 81

#8 Updated by rchan 2 months ago

  • Sprint changed from Sprint 81 to Sprint 82

#9 Updated by dkliban@redhat.com 2 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com

#10 Updated by pulpbot 2 months ago

  • Status changed from ASSIGNED to POST

#11 Updated by rchan about 2 months ago

  • Sprint changed from Sprint 82 to Sprint 83

#12 Updated by dkliban@redhat.com about 2 months ago

  • Status changed from POST to MODIFIED

#13 Updated by jsherril@redhat.com about 2 months ago

  • Related to Backport #7702: Backport Request: 7147 (AttributeError: 'Package' object has no attribute '_remote_artifact_saver_cas') to 3.7 added

#14 Updated by ttereshc about 1 month ago

  • Sprint/Milestone set to 3.8.0

#15 Updated by pulpbot about 1 month ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Please register to edit this issue

Also available in: Atom PDF