NodeBB could not connect to your Mongo database. Mongo returned the following error: Authentication failed.



  • No matter what I do I cannot connect to the mongodb.

    I have tried setting auth=true in /etc/mongod.conf, setting readAnyDatabase and readWriteAnyDatabase on admin. I have also add user for the specific database and given permissions, yet everytime I run ./nodebb setup I get the following error

    make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1
    make: Leaving directory /home/nodeside/nodebb/node_modules/mongodb/node_modules/kerberos/build' gyp ERR! build error gyp ERR! stack Error:make` failed with exit code: 2
    gyp ERR! stack at ChildProcess.onExit (/home/nodeside/nodebb/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
    gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
    gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
    gyp ERR! System Linux 3.13.0-57-generic
    gyp ERR! command "node" "/home/nodeside/nodebb/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
    gyp ERR! cwd /home/nodeside/nodebb/node_modules/mongodb/node_modules/kerberos
    gyp ERR! node -v v0.10.25
    gyp ERR! node-gyp -v v3.0.3
    gyp ERR! not ok
    connect-mongo@0.8.2 node_modules/connect-mongo
    ├── depd@1.1.0
    ├── debug@2.2.0 (ms@0.7.1)
    └── lodash@3.10.1

    mongodb@2.0.48 node_modules/mongodb
    ├── readable-stream@1.0.31 (isarray@0.0.1, inherits@2.0.1, string_decoder@0.10.31, core-util-is@1.0.2)
    ├── es6-promise@2.1.1
    ├── kerberos@0.0.17 (nan@2.0.9)
    └── mongodb-core@1.2.21 (bson@0.4.19)
    20/11 06:15 [4392] - error: NodeBB could not connect to your Mongo database. Mongo returned the following error: Authentication failed.
    20/11 06:15 [4392] - warn: NodeBB Setup Aborted.
    MongoError: Authentication failed.
    at Function.MongoError.create (/home/nodeside/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/error.js:31:11)
    at /home/nodeside/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:770:66
    at Callbacks.emit (/home/nodeside/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:95:3)
    at null.messageHandler (/home/nodeside/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:243:23)
    at Socket.<anonymous> (/home/nodeside/nodebb/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:262:22)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Socket.<anonymous> (stream_readable.js:746:14)
    at Socket.EventEmitter.emit (events.js:92:17)
    at emitReadable
    (_stream_readable.js:408:10)
    at emitReadable (_stream_readable.js:404:5)

    Any ideas why?



  • Try connecting manually. Use the mongo client and see what that does using the creds that you are attempting to use.


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.