-
Bug
-
Resolution: Unresolved
-
Normal
-
None
-
6.15.5, 6.16.5, 6.17.1
Description of problem:
Container repository failed to import with the following error:
{"traceback"=>" File \"/usr/lib/python3.11/site-packages/pulpcore/tasking/tasks.py\", line 66, in _execute_task result = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/pulpcore/app/tasks/importer.py\", line 380, in import_repository_version for a_result in _import_file(os.path.join(rv_path, filename), res_class, retry=True): File \"/usr/lib/python3.11/site-packages/pulpcore/app/tasks/importer.py\", line 268, in _import_file a_result = resource.import_data(data, raise_errors=True) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/import_export/resources.py\", line 813, in import_data result = self.import_data_inner( ^^^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/import_export/resources.py\", line 882, in import_data_inner raise row_result.errors[-1].error File \"/usr/lib/python3.11/site-packages/import_export/resources.py\", line 737, in import_row self.import_obj(instance, row, dry_run, **kwargs) File \"/usr/lib/python3.11/site-packages/import_export/resources.py\", line 557, in import_obj self.import_field(field, obj, data, **kwargs) File \"/usr/lib/python3.11/site-packages/import_export/resources.py\", line 540, in import_field field.save(obj, data, is_m2m, **kwargs) File \"/usr/lib/python3.11/site-packages/import_export/fields.py\", line 119, in save cleaned = self.clean(data, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/import_export/fields.py\", line 75, in clean value = self.widget.clean(value, row=data, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/import_export/widgets.py\", line 423, in clean return self.get_queryset(value, row, **kwargs).get(**{self.field: val}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File \"/usr/lib/python3.11/site-packages/django/db/models/query.py\", line 637, in get raise self.model.DoesNotExist( ", "description"=>"Manifest matching query does not exist."}
When a digest of the manifest list in the syncing upstream repository has changed (For example, the new manifest list removed a couple of manifests and the other manifests remain unchanged). In this case, Pulp will create a new manifest list entry and associated all the existing manifests with it.
This means the old manifest list and the new manifest list are associating to the same manifests in the "container_manifestlistmanifest" table. When exporting the data in "manifestlistmanifest", Pulp will export all data in the current repository version. Since the old manifest list is still associating to them it will be exported. See the code below:
class ManifestListManifestResource(QueryModelResource): def set_up_queryset(self): """ :return: Manifests specific to a specified repo-version. """ return ManifestListManifest.objects.filter( manifest_list__pk__in=self.repo_version.content <======= ).order_by("id")
However, the manifest resource will not export the old manifest which is correct
How reproducible:
In some cases only so it is hard to reproduce without making change in the database to simulate the case.
Is this issue a regression from an earlier version:
no