Project

Profile

Help

Issue #4225

0029_applicability_schema_change.py fails for some users

Added by daviddavis 5 months ago. Updated 5 days ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Severity:
3. High
Version:
Platform Release:
2.18.1
Blocks Release:
OS:
Backwards Incompatible:
No
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
QA Contact:
Complexity:
Smash Test:
Verified:
No
Verification Required:
No
Sprint:

Description

A user reported hitting this error:

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]

I tested and couldn't reproduce. I think the difference might be mongo or pymongo versions. I was using:

python2-pymongo-gridfs-3.6.1-1.fc28.x86_64
python2-mongoengine-0.15.3-1.fc28.noarch
mongodb-server-3.6.6-1.fc28.x86_64
python2-pymongo-3.6.1-1.fc28.x86_64
mongodb-3.6.6-1.fc28.x86_64

The user was using:

python-pymongo-gridfs-3.2-2.el7.x86_64
python-pymongo-3.2-2.el7.x86_64
python-mongoengine-0.10.5-1.el7.noarch
mongodb-server-2.6.12-6.el7.x86_64

This patch seemed to fix the problem for the user:

https://gist.github.com/04eed3d374a01cad34cbe97bb1222794


Related issues

Duplicated by Pulp - Issue #4226: Upgrade from 2.17 to 2.18 failed CLOSED - DUPLICATE Actions

Associated revisions

Revision 9390a43b View on GitHub
Added by ttereshc 5 months ago

Don't fail migration in case there is no exception code

Not all MongoDB versions report a specific code whe index is not found.

closes #4225
https://pulp.plan.io/issues/4225

Revision 047a8192 View on GitHub
Added by ttereshc 3 months ago

Don't fail migration in case there is no exception code

Not all MongoDB versions report a specific code whe index is not found.

closes #4225
https://pulp.plan.io/issues/4225

History

#1 Updated by ttereshc 5 months ago

  • Duplicated by Issue #4226: Upgrade from 2.17 to 2.18 failed added

#2 Updated by ttereshc 5 months ago

I believe it's MongoDB version and not a pymongo one. Katello successfully used our Pulp repo which contains versions of pymongo and mongoengine installed on user's system.

I added docs to encourage MongoDB 3.x installation.

+1 to fix this issue as suggested in the gist.

#3 Updated by ttereshc 5 months ago

  • Status changed from NEW to POST

#4 Updated by ttereshc 5 months ago

  • Status changed from POST to MODIFIED

#5 Updated by ttereshc 5 months ago

  • Platform Release set to 2.18.1

#7 Updated by jortel@redhat.com 2 months ago

  • Status changed from MODIFIED to ON_QA

#8 Updated by jortel@redhat.com about 2 months ago

  • Status changed from ON_QA to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter 5 days ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF