Unable to start server MongoError: command listIndexes requires authentication
biznlinks opened this issue · 1 comments
biznlinks commented
Getting the following error message below. What to do?
Express server listening on port 3000 in development mode
(node:23133) UnhandledPromiseRejectionWarning: MongoError: command listIndexes requires authentication
at Function.MongoError.create (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/bitnami/pisignage-server/node_modules/mongodb-core/lib/connection/pool.js:469:18
at process._tickCallback (internal/process/next_tick.js:61:11)
(node:23133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:23133) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:23133) UnhandledPromiseRejectionWarning: MongoError: command listIndexes requires authentication
at Function.MongoError.create (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/bitnami/pisignage-server/node_modules/mongodb-core/lib/connection/pool.js:469:18
at process._tickCallback (internal/process/next_tick.js:61:11)
(node:23133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:23133) UnhandledPromiseRejectionWarning: MongoError: command listIndexes requires authentication
at Function.MongoError.create (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/bitnami/pisignage-server/node_modules/mongodb-core/lib/connection/pool.js:469:18
at process._tickCallback (internal/process/next_tick.js:61:11)
(node:23133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:23133) UnhandledPromiseRejectionWarning: MongoError: command listIndexes requires authentication
at Function.MongoError.create (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/error.js:31:11)
at queryCallback (/home/bitnami/pisignage-server/node_modules/mongodb-core/lib/cursor.js:212:36)
at /home/bitnami/pisignage-server/node_modules/mongodb-core/lib/connection/pool.js:469:18
at process._tickCallback (internal/process/next_tick.js:61:11)
(node:23133) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 4)
events.js:174
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'installation' of undefined
at /home/bitnami/pisignage-server/app/controllers/licenses.js:130:50
at /home/bitnami/pisignage-server/node_modules/mongoose/lib/model.js:4092:16
at /home/bitnami/pisignage-server/node_modules/mongoose/lib/services/model/applyHooks.js:175:17
at process._tickCallback (internal/process/next_tick.js:61:11)
Emitted 'error' event at:
at /home/bitnami/pisignage-server/node_modules/mongoose/lib/model.js:4094:13
at /home/bitnami/pisignage-server/node_modules/mongoose/lib/services/model/applyHooks.js:175:17
at process._tickCallback (internal/process/next_tick.js:61:11)
colloqi commented
Is this the case ? "MONGO_INITDB_ROOT_USERNAME and MONGO_INITDB_ROOT_PASSWORD environment variables, it will make mongod running with the --auth option" If so you may have to enable mongoose authentication in the mongoose (this link may help https://stackoverflow.com/questions/26694824/how-to-authenticate-mongoose-connection-mongodb-in-node-js)