#5 Frame 0x7f2e5a86d3f0, for file /usr/local/lib/python2.7/dist-packages/pymongo/topology.py, line 59, in open (self=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f2e5b7fe350>, acquire=<built-in method acquire of thread.lock object at remote 0x7f2e5b7fe350>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f2e5b7fe350>) at remote 0x7f2e5a86a590>) at remote 0x7f2e5a86a550>, _interval=10, _stopped=False, _min_interval=<float at remote 0x1fed2b0>) at remote 0x7f2e5a86a510>, _settings=<TopologySettings(_monitor_class=<type at remote 0x20db090>, _seeds=set([(...)]), _pool_options=<PoolOptions at remote 0x7f2e5a8b0fa0>, _local_threshold_ms=15, _pool_class=<class...(truncated)
with self._lock:
#8 Frame 0x7f2e595c2c20, for file /usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py, line 658, in _get_topology (self=<MongoClient(_MongoClient__kill_cursors_queue=[], _MongoClient__all_credentials={}, _MongoClient__default_database_name=None, _MongoClient__lock=<thread.lock at remote 0x7f2e5b7fe290>, _topology=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f2e5b7fe350>, acquire=<built-in method acquire of thread.lock object at remote 0x7f2e5b7fe350>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f2e5b7fe350>) at remote 0x7f2e5a86a590>) at remote 0x7f2e5a86a550>, _interval=10, _stopped=False, _min_interval=<float at remote 0x1fed2b0>) at rem...(truncated)
self._topology.open()
#11 Frame 0x7f2e5a8799d8, for file /usr/local/lib/python2.7/dist-packages/pymongo/mongo_client.py, line 663, in _get_socket (self=<MongoClient(_MongoClient__kill_cursors_queue=[], _MongoClient__all_credentials={}, _MongoClient__default_database_name=None, _MongoClient__lock=<thread.lock at remote 0x7f2e5b7fe290>, _topology=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f2e5b7fe350>, acquire=<built-in method acquire of thread.lock object at remote 0x7f2e5b7fe350>, _Condition__waiters=[], release=<built-in method release of thread.lock object at remote 0x7f2e5b7fe350>) at remote 0x7f2e5a86a590>) at remote 0x7f2e5a86a550>, _interval=10, _stopped=False, _min_interval=<float at remote 0x1fed2b0>) at remot...(truncated)
server = self._get_topology().select_server(selector)
#18 Frame 0x3934a40, for file /usr/lib/python2.7/contextlib.py, line 17, in __enter__ (self=<GeneratorContextManager(gen=<generator at remote 0x7f2e58c0cc80>) at remote 0x7f2e58bdb2d0>)
return self.gen.next()
#25 Frame 0x21bc7a0, for file /usr/local/lib/python2.7/dist-packages/pymongo/collection.py, line 1074, in __create_index (self=<Collection(_BaseObject__read_preference=<Primary at remote 0x7f2e5ba55520>, _Collection__name=u'dead_lock', _Collection__database=<Database(_Database__client=<MongoClient(_MongoClient__kill_cursors_queue=[], _MongoClient__all_credentials={}, _MongoClient__default_database_name=None, _MongoClient__lock=<thread.lock at remote 0x7f2e5b7fe290>, _topology=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f2e5b7fe350>, acquire=<built-in method acquire of thread.lock object at remote 0x7f2e5b7fe350>, _Condition__waiters=[], release=<built-in method release of thread.lock object at rem...(truncated)
with self._socket_for_writes() as sock_info:
#28 Frame 0x7f2e5a87cd70, for file /usr/local/lib/python2.7/dist-packages/pymongo/collection.py, line 1163, in create_index (self=<Collection(_BaseObject__read_preference=<Primary at remote 0x7f2e5ba55520>, _Collection__name=u'dead_lock', _Collection__database=<Database(_Database__client=<MongoClient(_MongoClient__kill_cursors_queue=[], _MongoClient__all_credentials={}, _MongoClient__default_database_name=None, _MongoClient__lock=<thread.lock at remote 0x7f2e5b7fe290>, _topology=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<thread.lock at remote 0x7f2e5b7fe350>, acquire=<built-in method acquire of thread.lock object at remote 0x7f2e5b7fe350>, _Condition__waiters=[], release=<built-in method release of thread.lock object at ...(truncated)
self.__create_index(keys, kwargs)
#33 Frame 0x21bc310, for file /usr/local/lib/python2.7/dist-packages/mongoengine/document.py, line 749, in ensure_indexes (cls=<TopLevelDocumentMetaclass(__module__='__main__', _superclasses=(), _subclasses=('DeadLock',), run_once=<function at remote 0x7f2e5a866aa0>, objects=<QuerySetManager at remote 0x7f2e5a86abd0>, _collection=<Collection(_BaseObject__read_preference=<Primary at remote 0x7f2e5ba55520>, _Collection__name=u'dead_lock', _Collection__database=<Database(_Database__client=<MongoClient(_MongoClient__kill_cursors_queue=[], _MongoClient__all_credentials={}, _MongoClient__default_database_name=None, _MongoClient__lock=<thread.lock at remote 0x7f2e5b7fe290>, _topology=<Topology(_servers={('localhost', 27017): <Server(_monitor=<Monitor(_server_description=<ServerDescription at remote 0x7f2e5a8427e0>, _executor=<PeriodicExecutor(_thread=<weakproxy at remote 0x7f2e5a85ea48>, _target=<function at remote 0x7f2e5a84d0c8>, _event=<Event(_flag=False, _cond=<_Condition(_Verbose__verbose=False, _Condition__lock=<t...(truncated)
collection.create_index(fields, background=background, **opts)
#36 Frame 0x7f2e595bf050, for file lock.py, line 29, in run_once (self=<DeadLock at remote 0x7f2e5a843e50>, i=27130)
self.ensure_indexes()