Issue #5981
closedMigration fails if the same repo is migrated again with different name in pulp3
Description
To reproduce:
- migrate a repo with random name for pulp3
- migrate a repo with a different name (or just migrate all and the pulp2 name will be chosen)
- observe the error:
]: pulp: rq.worker:ERROR: pulp_file.app.models.FileRepository.DoesNotExist: FileRepository matching query does not exist.
]: Traceback (most recent call last):
]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/worker.py", line 822, in perform_job
]: rv = job.perform()
]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 605, in perform
]: self._result = self._execute()
]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/rq/job.py", line 611, in _execute
]: return self.func(*self.args, **self.kwargs)
]: File "/home/vagrant/devel/pulp-2to3-migrate/pulp_2to3_migration/app/tasks/migrate.py", line 113, in migrate_from_pulp2
]: loop.run_until_complete(create_repo_versions(plan))
]: File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
]: return future.result()
]: File "/home/vagrant/devel/pulp-2to3-migrate/pulp_2to3_migration/app/migration.py", line 265, in create_repo_versions
]: create_repo_version(plugin.migrator, pulp2_repo.pulp2_repo_id, pulp2_repo)
]: File "/home/vagrant/devel/pulp-2to3-migrate/pulp_2to3_migration/app/migration.py", line 233, in create_repo_version
]: pulp3_repo = repository_class.objects.get(name=pulp3_repo_name)
]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
]: return getattr(self.get_queryset(), name)(*args, **kwargs)
]: File "/usr/local/lib/pulp/lib64/python3.6/site-packages/django/db/models/query.py", line 408, in get
]: self.model._meta.object_name
]: pulp_file.app.models.FileRepository.DoesNotExist: FileRepository matching query does not exist.
Files
Updated by ttereshc over 4 years ago
- Project changed from Pulp to Migration Plugin
Updated by dalley about 4 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dalley
Updated by dalley about 4 years ago
When I run this I don't get an error. However, the repository that was migrated to Pulp 3 first retains the name that was used the first time around, whereas I probably would have expected it to re-do the migration from the beginning.
(pulp) [vagrant@pulp2-nightly-pulp3-source-centos7 pulpcore]$ http GET :24817/pulp/api/v3/repositories/file/file/
HTTP/1.1 200 OK
Allow: GET, POST, HEAD, OPTIONS
Connection: close
Content-Length: 1587
Content-Type: application/json
Date: Tue, 28 Jan 2020 01:43:35 GMT
Server: gunicorn/20.0.4
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"count": 4,
"next": null,
"previous": null,
"results": [
{
"description": null,
"latest_version_href": "/pulp/api/v3/repositories/file/file/586df110-1635-42d0-94a4-37f81190d6e9/versions/1/",
"name": "file-many",
"pulp_created": "2020-01-28T01:43:03.611220Z",
"pulp_href": "/pulp/api/v3/repositories/file/file/586df110-1635-42d0-94a4-37f81190d6e9/",
"versions_href": "/pulp/api/v3/repositories/file/file/586df110-1635-42d0-94a4-37f81190d6e9/versions/"
},
{
"description": null,
"latest_version_href": "/pulp/api/v3/repositories/file/file/73e72108-4650-4947-b60d-bab0df6284b8/versions/1/",
"name": "file2",
"pulp_created": "2020-01-28T01:43:03.615098Z",
"pulp_href": "/pulp/api/v3/repositories/file/file/73e72108-4650-4947-b60d-bab0df6284b8/",
"versions_href": "/pulp/api/v3/repositories/file/file/73e72108-4650-4947-b60d-bab0df6284b8/versions/"
},
{
"description": "pulp3file",
"latest_version_href": "/pulp/api/v3/repositories/file/file/a3d7d160-c7c0-4ab9-b977-f3c5620c9c16/versions/1/",
"name": "pulp3file",
"pulp_created": "2020-01-28T01:42:29.538840Z",
"pulp_href": "/pulp/api/v3/repositories/file/file/a3d7d160-c7c0-4ab9-b977-f3c5620c9c16/",
"versions_href": "/pulp/api/v3/repositories/file/file/a3d7d160-c7c0-4ab9-b977-f3c5620c9c16/versions/"
},
{
"description": null,
"latest_version_href": "/pulp/api/v3/repositories/file/file/e50429aa-cbd3-4c08-929a-b053ab78ccc1/versions/1/",
"name": "file-large",
"pulp_created": "2020-01-28T01:43:03.606501Z",
"pulp_href": "/pulp/api/v3/repositories/file/file/e50429aa-cbd3-4c08-929a-b053ab78ccc1/",
"versions_href": "/pulp/api/v3/repositories/file/file/e50429aa-cbd3-4c08-929a-b053ab78ccc1/versions/"
}
]
}
Updated by dalley about 4 years ago
- Status changed from ASSIGNED to POST
Updated by dalley about 4 years ago
- Status changed from POST to NEW
- Assignee deleted (
dalley)
Updated by ipanova@redhat.com about 4 years ago
- Description updated (diff)
- Triaged changed from No to Yes
Updated by bmbouter almost 4 years ago
- Tags deleted (
Pulp 2 to 3 Migrate)
We're removing the 'Pulp 2 to 3 Migrate' tag to allow membership of the Migration Plugin project in Redmine to be the controlling area https://pulp.plan.io/projects/migration
Updated by dalley over 3 years ago
- File 5981_name_repo.py added
The current behavior is that if the name is changed, a new Pulp 3 repository is created with the same name, but it is not populated with content.
So the old repository remains and has the correct content, and a new repository is created but not populated.
Reproducer attached.
Updated by dalley about 3 years ago
- File 5981_name_repo.py 5981_name_repo.py added
- File deleted (
5981_name_repo.py)
Updated by ttereshc about 3 years ago
- Status changed from NEW to CLOSED - WONTFIX
Katello is not affected, users who migrate everything with a simple plan are not affected as well. This issue is not on a roadmap. Please open a new one if you are affected and need this one to be fixed.