Issue #7260
Updated by ttereshc over 4 years ago
We migrate only those LCEs which are specified in the treeinfo images https://github.com/pulp/pulp-2to3-migration/blob/master/pulp_2to3_migration/app/plugin/content.py#L292. We need to flip the flag is_migrated to True for the rest of LCEs (for so the items which are re-migration does not migrated to Pulp3) so they are not giving false negatives on re-migration. fail. ``` > db.lazy_content_catalog.find({"unit_type_id":"distribution", "unit_id" : "668466ab-f831-49e8-a3d4-af7c64591062"}, {"url":1}) { "_id" : ObjectId("5ee0d58dc998ac0f7f595571"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/LiveOS/squashfs.img" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595572"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/images/pxeboot/upgrade.img" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595573"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/images/pxeboot/vmlinuz" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595574"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/images/pxeboot/initrd.img" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595575"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/upgrade.img\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595576"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/TRANS.TBL\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595577"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/memtest\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595578"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/vmlinuz\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595579"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/vesamenu.c32\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557a"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/boot.msg\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557b"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/initrd.img\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557c"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/isolinux.cfg\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557d"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/boot.cat\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557e"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/splash.png\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f59557f"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/isolinux.bin\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595580"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/isolinux/grub.conf\n" } { "_id" : ObjectId("5ee0d58dc998ac0f7f595581"), "url" : "https://repos.fedorapeople.org/pulp/pulp/fixtures/rpm-kickstart/PULP_DISTRIBUTION.xml" } > db.lazy_content_catalog.count({"unit_type_id":"distribution", "unit_id" : "668466ab-f831-49e8-a3d4-af7c64591062"}) 17 ``` After migration: ``` In [6]: pulp2lazycatalog = Pulp2LazyCatalog.objects.filter( ...: pulp2_unit_id="668466ab-f831-49e8-a3d4-af7c64591062", is_migrated=False) In [7]: pulp2lazycatalog.count() Out[7]: 13 ``` Re-mgration: ``` "error": { "description": "'NoneType' object is not iterable", "traceback": " File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py\", line 886, in perform_job\n rv = job.perform()\n File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 664, in perform\n self._result = self._execute()\n File \"/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py\", line 670, in _execute\n return self.func(*self.args, **self.kwargs)\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/tasks/migrate.py\", line 141, in migrate_from_pulp2\n migrate_content(plan)\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/migration.py\", line 36, in migrate_content\n plugin.migrator.migrate_content_to_pulp3()\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/rpm/migrator.py\", line 141, in migrate_content_to_pulp3\n loop.run_until_complete(dm.create())\n File \"/usr/lib64/python3.6/asyncio/base_events.py\", line 484, in run_until_complete\n return future.result()\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/content.py\", line 86, in create\n await pipeline\n File \"/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py\", line 225, in create_pipeline\n await asyncio.gather(*futures)\n File \"/home/vagrant/devel/pulpcore/pulpcore/plugin/stages/api.py\", line 43, in __call__\n await self.run()\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/content.py\", line 191, in run\n self.migrate_to_pulp3(cmodel, ctype)\n File \"/home/vagrant/devel/pulp-2to3-migration/pulp_2to3_migration/app/plugin/content.py\", line 282, in migrate_to_pulp3\n pulp3content, extra_info = pulp_2to3_detail_content.create_pulp3_content()\n" ```