Project

Profile

Help

Issue #1707

Repository's repo_id duplicate key error on upgrade

Added by amacdona@redhat.com almost 5 years ago. Updated almost 2 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

http://projects.theforeman.org/issues/13807

Feb 18 13:35:01 centos7-2-4 pulp: py.warnings:WARNING: (11302-47008)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:INFO: Migration to pulp_rpm.plugins.migrations version 23 complete.
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:INFO: Applying pulp_rpm.plugins.migrations version 24
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:INFO: Migration to pulp_rpm.plugins.migrations version 24 complete.
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: E11000 duplicate key error index: pulp_database.repos.$repo_id_-1  dup key: { : null }
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008) Traceback (most recent call last):
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 183, in main
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     return _auto_manage_db(options)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 246, in _auto_manage_db
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     migrate_database(options)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 142, in migrate_database
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     ensure_database_indexes()
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/pulp/server/db/manage.py", line 157, in ensure_database_indexes
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     model.Repository.ensure_indexes()
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 738, in ensure_indexes
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     collection = cls._get_collection()
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 210, in _get_collection
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     cls.ensure_indexes()
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib/python2.7/site-packages/mongoengine/document.py", line 766, in ensure_indexes
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     collection.create_index(fields, background=background, **opts)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 1380, in create_index
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     self.__create_index(keys, kwargs)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 1290, in __create_index
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     sock_info, cmd, read_preference=ReadPreference.PRIMARY)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 205, in _command
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     read_concern=read_concern)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/pool.py", line 211, in command
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     read_concern)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/network.py", line 100, in command
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     helpers._check_command_response(response_doc, msg, allowable_errors)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)   File "/usr/lib64/python2.7/site-packages/pymongo/helpers.py", line 189, in _check_command_response
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008)     raise DuplicateKeyError(errmsg, code, response)
Feb 18 13:35:01 centos7-2-4 pulp: pulp.server.db.manage:CRITICAL: (11302-47008) DuplicateKeyError: E11000 duplicate key error index: pulp_database.repos.$repo_id_-1  dup key: { : null }

I believe that this is due to renaming a field before dropping the index.

Associated revisions

Revision 109e2655 View on GitHub
Added by Austin Macdonald almost 5 years ago

fix repository migration

closes #1707

Revision 109e2655 View on GitHub
Added by Austin Macdonald almost 5 years ago

fix repository migration

closes #1707

History

#1 Updated by amacdona@redhat.com almost 5 years ago

  • Priority changed from Normal to High
  • Severity changed from 2. Medium to 3. High
  • Platform Release set to 2.8.0

#2 Updated by amacdona@redhat.com almost 5 years ago

  • Status changed from ASSIGNED to POST

#3 Updated by Anonymous almost 5 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#4 Updated by amacdona@redhat.com almost 5 years ago

  • Triaged changed from No to Yes

#5 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from MODIFIED to 5

#6 Updated by pthomas@redhat.com almost 5 years ago

  • Status changed from 5 to 6

verified
Migration passes for
2.6->2.8 & 2.7 -> 2.8

#7 Updated by dkliban@redhat.com almost 5 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#9 Updated by bmbouter almost 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF