Bug 1080609 - DuplicateKeyError: E11000 duplicate key error index: pulp_database.users.$login_-1 dup key: { : "admin" }
Summary: DuplicateKeyError: E11000 duplicate key error index: pulp_database.users.$log...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Pulp
Classification: Retired
Component: user-experience
Version: 2.4 Beta
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.4.0
Assignee: Randy Barlow
QA Contact: Ina Panova
URL:
Whiteboard:
: 772230 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-03-25 19:04 UTC by John Matthews
Modified: 2014-11-07 22:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-09 06:56:23 UTC
Embargoed:


Attachments (Terms of Use)

Description John Matthews 2014-03-25 19:04:32 UTC
Description of problem:

On a fresh install I am seeing the below message, additionally I am seeing a segfault from a python process and pulp is not available until I restart 'httpd'

DuplicateKeyError: E11000 duplicate key error index: pulp_database.users.$login_-1  dup key: { : "admin" }

This was seen on a fresh Fedora 20 VM.

Note, if I run "systemctl restart httpd" Pulp is happy and I'm able to login and create/sync a repo.
It's the initial run of 'httpd' and the celery workers which is triggering the below.


Version-Release number of selected component (if applicable):
pulp-server-2.4.0-0.6.alpha.fc20.noarch

How reproducible:
Always


Steps to Reproduce:
1. Start on a fresh Fedora 20 VM
2. Follow user guide and install pulp 2.4 beta
3. Start services as:
systemctl enable qpidd 
systemctl start qpidd

systemctl enable httpd
systemctl start httpd

systemctl enable pulp_workers.service
systemctl start pulp_workers.service 

systemctl enable pulp_resource_manager.service
systemctl start pulp_resource_manager.service

systemctl enable pulp_celerybeat.service
systemctl start pulp_celerybeat.service

4. Look at /var/log/messages
Note exception

Actual results:

Mar 25 14:13:13 localhost pulp: pulp.server.webservices.application:INFO: *************************************************************
Mar 25 14:13:13 localhost pulp: pulp.server.webservices.application:INFO: The Pulp server has been successfully initialized
Mar 25 14:13:13 localhost pulp: pulp.server.webservices.application:INFO: *************************************************************
Mar 25 14:13:13 localhost kernel: [  200.368118] httpd[2788]: segfault at 58 ip 00007fc73f9d4797 sp 00007fc7332316c0 error 4 in libpython2.7.so.1.0[7fc73f8f5000+178000]
Mar 25 14:13:13 localhost kernel: httpd[2788]: segfault at 58 ip 00007fc73f9d4797 sp 00007fc7332316c0 error 4 in libpython2.7.so.1.0[7fc73f8f5000+178000]
Mar 25 14:13:13 localhost pulp: pulp.server.webservices.application:CRITICAL: *************************************************************
Mar 25 14:13:13 localhost pulp: pulp.server.webservices.application:ERROR: The Pulp server encountered an unexpected failure during initialization
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 151, in wsgi_application
    _initialize_pulp()
  File "/usr/lib/python2.7/site-packages/pulp/server/webservices/application.py", line 115, in _initialize_pulp
    user_manager.ensure_admin()
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/auth/user/cud.py", line 214, in ensure_admin
    password=default_password)
  File "/usr/lib/python2.7/site-packages/pulp/server/managers/auth/user/cud.py", line 88, in create_user
    User.get_collection().save(create_me, safe=True)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 135, in retry
    return method(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 269, in save
    manipulate, safe, check_keys=check_keys, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 135, in retry
    return method(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/pymongo/collection.py", line 479, in update
    check_keys, self.__uuid_subtype), safe)
  File "/usr/lib/python2.7/site-packages/pulp/server/db/connection.py", line 166, in _with_end_request
    return method(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 920, in _send_message
    rv = self.__check_response_to_last_error(response)
  File "/usr/lib64/python2.7/site-packages/pymongo/mongo_client.py", line 861, in __check_response_to_last_error
    raise DuplicateKeyError(details["err"], details["code"])
DuplicateKeyError: E11000 duplicate key error index: pulp_database.users.$login_-1  dup key: { : "admin" }

Comment 1 Randy Barlow 2014-04-17 18:40:03 UTC
https://github.com/pulp/pulp/pull/905

Comment 2 Randy Barlow 2014-04-24 20:28:37 UTC
The fix for this bug is included in the 2.4.0-0.10.beta build that was just published to the Pulp fedorapeople.org repository.

Comment 3 Ina Panova 2014-05-15 17:37:15 UTC
Tested in 2.4.0-0.14.beta
No issues met during the login, no DuplicateKeyError traceback found.

Moving to Verified.

Comment 4 Randy Barlow 2014-08-09 06:56:23 UTC
This has been fixed in Pulp 2.4.0-1.

Comment 5 Chris Duryee 2014-11-07 22:38:19 UTC
*** Bug 772230 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.