4

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 ?

2 Answers2

6

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).

Nicola Iarocci
  • 6,606
  • 1
  • 20
  • 33
4
  1. get your mongodb's dbname,username and password from setting.py,eg:

    MONGO_USERNAME = 'username'
    
    MONGO_PASSWORD = 'password'
    
    MONGO_DBNAME = 'apitest'
    
  2. login in mongod server with mongo,and make sure your username in dbname's system.user collection.you can query authenticated users in that database with the following operation:

    use apitest
    
    db.system.users.find()
    
  3. if username doesn't exist in system.users,then you can use db.addUser command to add a user to system.users collection.eg:

    use apitest
    
    db.addUser{'username','password'}
    
Qantas 94 Heavy
  • 15,750
  • 31
  • 68
  • 83
KevinQiang
  • 341
  • 2
  • 3
  • @FranciscoCorrales Yes,this problem is happened to me, and I use above steps address it. also thanks for Nicola Iarocci。 – KevinQiang Mar 10 '14 at 01:51
  • 3
    Great answer. Just one issue. It should be: db.addUser('username', 'password') ... Using the {...} won't work. – Joe Aug 01 '14 at 22:45