Issue #1753
closedErrors migrating pulp after upgrading katello 2.4 to 3.0
Description
After upgrading katello, I used sudo -u apache pulp-manage-db and saw this error
Beginning database migrations.
Migration package pulp.server.db.migrations is up to date at version 22
Migration package pulp_docker.plugins.migrations is up to date at version 1
Migration package pulp_puppet.plugins.migrations is up to date at version 3
Applying pulp_rpm.plugins.migrations version 25
Applying migration pulp_rpm.plugins.migrations.0025_export_relative_url failed.
Halting migrations due to a migration failure.
'repo_id'
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 193, in main
return _auto_manage_db(options)
File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 256, in _auto_manage_db
migrate_database(options)
File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 124, in migrate_database
update_current_version=not options.test)
File "/usr/lib/python2.7/site-packages/pulp/server/db/migrate/models.py", line 186, in apply_migration
migration.migrate()
File "/usr/lib/python2.7/site-packages/pulp_rpm/plugins/migrations/0025_export_relative_url.py", line 60, in migrate
distributors = list(repo_distributors.find({'repo_id': repo_object['repo_id']}))
KeyError: 'repo_id'
OS: CentOS Linux release 7.2.1511 (Core)
pulp version: pulp-server-2.8.0-0.8.beta.el7.noarch (and also tried nightly)
Related issues
Updated by jomitsch@redhat.com about 8 years ago
pulp 2.6.4 was in use before the upgrade
Updated by dkliban@redhat.com about 8 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to dkliban@redhat.com
Updated by dkliban@redhat.com about 8 years ago
I was not able to reproduce this issue.
Updated by jomitsch@redhat.com about 8 years ago
I also was not able to reproduce during a katello upgrade using pulp 2.8 beta 8. I will comment back if the migration error happens again.
Updated by jomitsch@redhat.com about 8 years ago
- Status changed from ASSIGNED to CLOSED - WORKSFORME
Updated by amacdona@redhat.com about 8 years ago
I believe this was fixed in this PR: https://github.com/pulp/pulp/pull/2445. If an earlier beta (beta 5) ran the affected migration, that migration would not run again on a newer beta (beta 8), allowing this issue to persist.
If anyone else has this issue, it is recommended that you upgrade directly to the newest beta from a previous release, not from a previous beta. However if you cannot upgrade directly, it should be possible to manually fix the data by dropping indexes in the repos collection, renaming the the `id` field to `repo_id` (don't forget multi=true) and then rerunning `sudo -u apache pulp-manage-db`.
Updated by dkliban@redhat.com about 8 years ago
- Has duplicate Issue #1772: Error migrating to 2.8 beta 0025_export_relative_url.py throws KeyError: 'repo_id' added