Issue #7147
Updated by ttereshc about 4 years ago
To reproduce:
- create repo A with the feed http://mirror.linux.duke.edu/pub/centos/8/BaseOS/x86_64/kickstart/ and sync
- create repo B with the same feed and sync
- migrate both repos
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](https://github.com/pulp/pulpcore/blob/b94abd64d76ea4554e6750ff38ce458eaa888cc8/pulpcore/plugin/stages/artifact_stages.py#L261) 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](https://github.com/pulp/pulpcore/blob/b94abd64d76ea4554e6750ff38ce458eaa888cc8/pulpcore/plugin/stages/artifact_stages.py#L261) , 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.