Project

Profile

Help

Issue #1753

closed

Errors migrating pulp after upgrading katello 2.4 to 3.0

Added by jomitsch@redhat.com about 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WORKSFORME
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Master
Platform Release:
2.8.0
OS:
CentOS 7
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

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

Has duplicate RPM Support - Issue #1772: Error migrating to 2.8 beta 0025_export_relative_url.py throws KeyError: 'repo_id'CLOSED - DUPLICATEActions
Actions #1

Updated by jomitsch@redhat.com about 8 years ago

pulp 2.6.4 was in use before the upgrade

Actions #2

Updated by dkliban@redhat.com about 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to dkliban@redhat.com
Actions #3

Updated by dkliban@redhat.com about 8 years ago

  • Platform Release set to 2.8.0
Actions #4

Updated by dkliban@redhat.com about 8 years ago

I was not able to reproduce this issue.

Actions #5

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.

Actions #6

Updated by jomitsch@redhat.com about 8 years ago

  • Status changed from ASSIGNED to CLOSED - WORKSFORME
Actions #7

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`.

Actions #8

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
Actions #9

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF