Project

Profile

Help

Issue #4226

Upgrade from 2.17 to 2.18 failed

Added by Poil about 3 years ago. Updated almost 3 years ago.

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

Description

Hi,

Nothing in the release note about how to upgrade, so I've first only do a "yum update"
When starting the service I have this error

Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)   The database has not been migrated to the current version. Run pulp-manage-db and restart the application.
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992) Traceback (most recent call last):
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 111, in wsgi_application
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)     _initialize_web_services()
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)   File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 74, in _initialize_web_services
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)     migration_models.check_package_versions()
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)   File "/usr/lib/python2.7/site-packages/pulp/server/db/migrate/models.py", line 314, in check_package_versions
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992)     raise Exception(error_message)
Dec  5 07:14:53 repos pulp: pulp.server.webservices.application:ERROR: (5296-72992) InitializationException: The database has not been migrated to the current version. Run pulp-manage-db and restart the application

So I've run "sudo -u apache pulp-manage-db"
And I've this error

Applying pulp.server.db.migrations version 29
*******************************************************************************
Applying migration pulp.server.db.migrations.0029_applicability_schema_change failed.

Halting migrations due to a migration failure.
command SON([('dropIndexes', u'repo_profile_applicability'), ('index', 'profile_hash_-1_repo_id_-1')]) on namespace pulp_database.$cmd failed: index not found with name [profile_hash_-1_repo_id_-1]
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 239, in main
    return _auto_manage_db(options)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 306, in _auto_manage_db
    migrate_database(options)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 135, in migrate_database
    update_current_version=not options.test)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/migrate/models.py", line 189, in apply_migration
    migration.migrate()
  File "/usr/lib/python2.7/site-packages/pulp/server/db/migrations/0029_applicability_schema_change.py", line 52, in migrate
    rpa_collection.drop_index("profile_hash_-1_repo_id_-1")
  File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 1456, in drop_index
    allowable_errors=["ns not found"])
  File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 205, in _command
    read_concern=read_concern)
  File "/usr/lib64/python2.7/site-packages/pymongo/pool.py", line 211, in command
    read_concern)
  File "/usr/lib64/python2.7/site-packages/pymongo/network.py", line 100, in command
    helpers._check_command_response(response_doc, msg, allowable_errors)
  File "/usr/lib64/python2.7/site-packages/pymongo/helpers.py", line 196, in _check_command_response
    raise OperationFailure(msg % errmsg, code, response)
OperationFailure: command SON([('dropIndexes', u'repo_profile_applicability'), ('index', 'profile_hash_-1_repo_id_-1')]) on namespace pulp_database.$cmd failed: index not found with name [profile_hash_-1_repo_id_-1]

Related issues

Is duplicate of RPM Support - Issue #4225: 0029_applicability_schema_change.py fails for some usersCLOSED - CURRENTRELEASE<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Poil about 3 years ago

I've renamed 0029_applicability_schema_change.py to 0029_applicability_schema_change.py.old and remove precompiled cache, and do my migration, the migration was very long and the application start, not sure if all is OK

#2 Updated by marcg about 3 years ago

I am facing the same error (same platform). Can you confirm the above workaround can be safely applied ?

#3 Updated by Poil about 3 years ago

For the moment I see nothing not working, except Crane UI but it's another problem

#4 Updated by ttereshc about 3 years ago

Please see https://pulp.plan.io/issues/4225
You are likely running old mongodb. If you don't consider upgrade, there is a workaround in the #4225

#5 Updated by ttereshc about 3 years ago

  • Status changed from NEW to CLOSED - DUPLICATE

#6 Updated by ttereshc about 3 years ago

  • Is duplicate of Issue #4225: 0029_applicability_schema_change.py fails for some users added

#7 Updated by Poil about 3 years ago

Thanks, and yes I'm running a old mongodb, I think like a lot of user that follow your install guide on EL7 :)

#8 Updated by ttereshc about 3 years ago

Thank you for your feedback!
I created a docs issue #4228 and made a PR with instructions on how to install MongoDB 3.x, feel free to review/comment.

#9 Updated by Poil about 3 years ago

Thanks, I think pulp use python-pymongo, Pulp EL7 package is 3.2 that does not seems to support MongoDB 3.2+ (I can find that PyMongo 3.3 supports MongoDB 2.4, 2.6, 3.0, and 3.2, but nothing on 3.2)

#10 Updated by ttereshc about 3 years ago

Interesting...
Katello uses SCL for mongodb 3.4 but still pymongo 3.2.
Compatibility table confirms your findings.

#11 Updated by bmbouter almost 3 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF