Project

Profile

Help

Issue #5981

Migration fails if the same repo is migrated again with different name in pulp3

Added by ttereshc 9 months ago. Updated 4 months ago.

Status:
NEW
Priority:
Normal
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

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.

History

#1 Updated by ttereshc 9 months ago

  • Project changed from Pulp to Migration Plugin

#2 Updated by dalley 8 months ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dalley

#3 Updated by dalley 8 months 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/"
        }
    ]
}

#4 Updated by dalley 8 months ago

  • Status changed from ASSIGNED to POST

#5 Updated by dalley 8 months ago

  • Status changed from POST to NEW
  • Assignee deleted (dalley)

#6 Updated by ipanova@redhat.com 8 months ago

  • Description updated (diff)
  • Triaged changed from No to Yes

#7 Updated by bmbouter 4 months 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

Please register to edit this issue

Also available in: Atom PDF