Project

Profile

Help

Issue #1753

Errors migrating pulp after upgrading katello 2.4 to 3.0

Added by jomitsch@redhat.com over 4 years ago. Updated over 1 year 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 - DUPLICATE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by jomitsch@redhat.com over 4 years ago

pulp 2.6.4 was in use before the upgrade

#2 Updated by dkliban@redhat.com over 4 years ago

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

#3 Updated by dkliban@redhat.com over 4 years ago

  • Platform Release set to 2.8.0

#4 Updated by dkliban@redhat.com over 4 years ago

I was not able to reproduce this issue.

#5 Updated by jomitsch@redhat.com over 4 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.

#6 Updated by jomitsch@redhat.com over 4 years ago

  • Status changed from ASSIGNED to CLOSED - WORKSFORME

#7 Updated by amacdona@redhat.com over 4 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`.

#8 Updated by dkliban@redhat.com over 4 years ago

  • Has duplicate Issue #1772: Error migrating to 2.8 beta 0025_export_relative_url.py throws KeyError: 'repo_id' added

#9 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF