Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ConnectionException connecting a Eve REST API to a MongoDB instance

I just installed the 'eve demo' I can't get it to start working.

The error is:

eve.io.base.ConnectionException: Error initializing the driver. Make sure the database serveris running. Driver exception: OperationFailure(u"command SON([('authenticate', 1), ('user', u'user'), ('nonce', u'cec66353cb35b6f5'), ('key', u'14817e596653376514b76248055e1d4f')]) failed: auth fails",)

I have mongoDB running, and I have installed Eve and Python2.7.

I create the run.py and the settings.py required.

What is not working ? am I missing something ?

like image 437
Francisco Corrales Morales Avatar asked Dec 26 '22 21:12

Francisco Corrales Morales


1 Answers

It looks like the MongoDB user/pw combo you configured in your settings.py has not been set at the db level. From the mongo shell type use <dbname>, then db.system.users.find() to get a list of authorized users for <dbname>. It is probably empty; add the user as needed (see the MongoDB docs).

like image 121
Nicola Iarocci Avatar answered Dec 29 '22 00:12

Nicola Iarocci