Project

Profile

Help

Issue #1059

DuplicateKeyError: E11000 duplicate key error index during migration from 2.4 to 2.6

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

Status:
CLOSED - NOTABUG
Priority:
Normal
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
2.4.0
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

Some context, a user hit the traceback below while upgrading a Katello. The pulp versions involved were a 2.4 to 2.6 upgrade.

Jun 16 11:09:47 katellosrv15 pulp: pulp.server.db.connection:INFO: Mongo database for connection is version 2.4.13
Jun 16 11:09:47 katellosrv15 pulp: pulp.server.db.manage:INFO: Loading content types.
Jun 16 11:09:47 katellosrv15 pulp: db:INFO: Loading type descriptors [puppet.json, docker.json, rpm_support.json, iso_support.json, nodes.json]
Jun 16 11:09:47 katellosrv15 pulp: db:INFO: Parsing type descriptors
Jun 16 11:09:47 katellosrv15 pulp: db:INFO: Validating type descriptor syntactic integrity
Jun 16 11:09:47 katellosrv15 pulp: db:INFO: Validating type descriptor semantic integrity
Jun 16 11:09:47 katellosrv15 pulp: db:INFO: Updating the database with types [puppet_module, docker_image, distribution, drpm, erratum, package_group, package_category, pa   ckage_environment, rpm, srpm, yum_repo_metadata_file, iso, repository, node]
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968) Exception updating unit key for type [rpm]
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968) Traceback (most recent call last):
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/types/database.py", line 119, in update_database
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     _update_unit_key(type_def)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/types/database.py", line 321, in _update_unit_key
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     _update_indexes(type_def, True)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/types/database.py", line 312, in _update_indexes
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     index_name = collection.ensure_index(mongo_index, unique=unique, drop_dups=False)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/server/db/connection.py", line 167, in retry
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     return method(*args, **kwargs)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 916, in ensure_index
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     return self.create_index(key_or_list, cache_for, **kwargs)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/server/db/connection.py", line 167, in retry
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     return method(*args, **kwargs)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 823, in create_index
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     **self._get_wc_override())
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib64/python2.6/site-packages/pymongo/collection.py", line 357, in insert
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     continue_on_error, self.__uuid_subtype), safe)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib64/python2.6/site-packages/pymongo/mongo_client.py", line 920, in _send_message
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     rv = self.__check_response_to_last_error(response)
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)   File "/usr/lib64/python2.6/site-packages/pymongo/mongo_client.py", line 861, in __check_response_to_last_error
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968)     raise DuplicateKeyError(details["err"], details["code"])
Jun 16 11:09:55 katellosrv15 pulp: db:ERROR: (31709-67968) DuplicateKeyError: E11000 duplicate key error index: pulp_database.units_rpm.$name_1_epoch_1_version_1_release_1   _arch_1_checksumtype_1_checksum_1  dup key: { : "DeviceKit-power-devel", : "0", : "014", : "3.el6", : "i686", : "sha", : "ef0922ec228c9aabbd6544e693f8bbd316cc2ca0" }
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: UpdateFailed [rpm]
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968) Traceback (most recent call last):
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 125, in main
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)     return _auto_manage_db(options)
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/server/db/manage.py", line 150, in _auto_man   age_db
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)     old_content_types = load_content_types(dry_run=options.dry_run)
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/loader/api.py", line 417, in load_co   ntent_types
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)     _load_type_definitions(descriptors)
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/loader/api.py", line 484, in _load_t   ype_definitions
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)     database.update_database(definitions)
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)   File "/usr/lib/python2.6/site-packages/pulp/plugins/types/database.py", line 133, in upd   ate_database
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)     raise UpdateFailed(error_defs)
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968) UpdateFailed: UpdateFailed [rpm]
Jun 16 11:09:56 katellosrv15 pulp: pulp.server.db.manage:CRITICAL: (31709-67968)

History

#1 Updated by rbarlow over 5 years ago

  • Status changed from NEW to CLOSED - NOTABUG

After some troubleshooting with the user who experienced this issue, I believe it is not a bug in Pulp. It turned out that they had somehow lost the uniqueness constraint in MongoDB that ensures that duplicate units are not created. We do not know how this happened, but I do not believe Pulp caused the indices to be dropped.

#2 Updated by bmbouter over 5 years ago

  • Triaged changed from No to Yes

#3 Updated by bmbouter almost 2 years ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF