"message" : "not authorized on admin to execute command { serverStatus: 1.0, recordStats: 0.0 }"

William Perroni shared this question 2 years ago
Answered

Somebody knows why my installation burst in this message when mongoBooster is initialized?

Comments (3)

photo
1

What version are you using? I supposed that you are using version 4.x.


Please try to turn off the following options.


  1. Options -> Restore Last Working State
  2. Options -> Auto Load ~/.mongorc.js File.

photo
1

Even after turning off these options I am facing this issue.

photo
1

Please back up and remove USER DATA and try it again.

1. Open NoSQLBooster, click Menu-> Help-> Open User Data Directory

2. Close NoSQLBooster

3. Backup and Remove User Data Directory. <NoSQLBooster for MongoDB>\*.*

4. Re-run NoSQLBooster

photo
1

After doing these steps also I am getting the error.

Mongodb version I am using is 3.4

photo
1

Dear Sir...I also facing the problem while using mongobooster for query with aggregation function it is like below....please help me to resolve this problem

"message" : "not authorized on strict to execute command { aggregate: 'PermanentBookings', pipeline: [ { $match: { $or: [ { city: 'Torino' } ], init_date: { $gte: new Date(1506816000000), $lte: new Date(1509494399000) } } }, { $project: { _id: 0.0, moved: { $ne: [ { $arrayElemAt: [ '$origin_destination.coordinates', 0.0 ] }, { $arrayElemAt: [ '$origin_destination.coordinates', 1.0 ] } ] }, duration: { $devide: [ { $subtract: [ '$final_time', '$init_time' ] }, 60.0 ] }, hourDay: { $hour: '$init_date' }, day: { $dayOfMonth: '$init_date' } } }, { $match: { moved: true, duration: { $lte: 180.0, $gt: 2.0 } } }, { $sort: { day: 1.0, hourDay: 1.0 } }, { $skip: 0.0 } ], cursor: {} }",

"stack" : "MongoError: not authorized on strict to execute command { aggregate: 'PermanentBookings', pipeline: [ { $match: { $or: [ { city: 'Torino' } ], init_date: { $gte: new Date(1506816000000), $lte: new Date(1509494399000) } } }, { $project: { _id: 0.0, moved: { $ne: [ { $arrayElemAt: [ '$origin_destination.coordinates', 0.0 ] }, { $arrayElemAt: [ '$origin_destination.coordinates', 1.0 ] } ] }, duration: { $devide: [ { $subtract: [ '$final_time', '$init_time' ] }, 60.0 ] }, hourDay: { $hour: '$init_date' }, day: { $dayOfMonth: '$init_date' } } }, { $match: { moved: true, duration: { $lte: 180.0, $gt: 2.0 } } }, { $sort: { day: 1.0, hourDay: 1.0 } }, { $skip: 0.0 } ], cursor: {} }" +

"at Function.MongoError.create (C:\\Users\\Pinky\\AppData\\Local\\mongobooster\\app-3.5.7\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\error.js:31:11)" +

"at queryCallback (C:\\Users\\Pinky\\AppData\\Local\\mongobooster\\app-3.5.7\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\cursor.js:212:36)" +

"at C:\\Users\\Pinky\\AppData\\Local\\mongobooster\\app-3.5.7\\resources\\app.asar\\node_modules\\mongodb-core\\lib\\connection\\pool.js:469:18" +

"at _combinedTickCallback (internal/process/next_tick.js:67:7)" +

"at process._tickCallback (internal/process/next_tick.js:98:9)",

"name" : "MongoError",

"ok" : 0,

"errmsg" : "not authorized on strict to execute command { aggregate: 'PermanentBookings', pipeline: [ { $match: { $or: [ { city: 'Torino' } ], init_date: { $gte: new Date(1506816000000), $lte: new Date(1509494399000) } } }, { $project: { _id: 0.0, moved: { $ne: [ { $arrayElemAt: [ '$origin_destination.coordinates', 0.0 ] }, { $arrayElemAt: [ '$origin_destination.coordinates', 1.0 ] } ] }, duration: { $devide: [ { $subtract: [ '$final_time', '$init_time' ] }, 60.0 ] }, hourDay: { $hour: '$init_date' }, day: { $dayOfMonth: '$init_date' } } }, { $match: { moved: true, duration: { $lte: 180.0, $gt: 2.0 } } }, { $sort: { day: 1.0, hourDay: 1.0 } }, { $skip: 0.0 } ], cursor: {} }",

"code" : 13,

"codeName" : "Unauthorized"

}

photo
1

From the description you gave, I couldn't give a solution. If possible, could you please give me a temporary accessible MongoDB URI and detailed reproduce steps?

photo
photo
1

reinstalled the mongo and redid the admnistative user ... and managed to connect with mongobooster. It was a bad howto which I followed.

At the final of soap opera ... I was with a doubt .... How MongoBooster connect on mongo server? What user ... how it get connect if it don't have any password?

Thanks a lot

photo
1

You can establish a secure connection with authentication. By default mongodb has no enabled access control, so there is no default user or password.


1. Menu-> File -> Connection... -> Edit -> Authentication Tab


1292109c6430d9c0d83a25469004950b


2. Or Menu -> File -> Quick Connection ...-> Enter you MongoDB URI that includes authentication credentials in the form of username:password@

mongodb://[username:password@]host:port/database?options


More about enable MongoDB Auth:

https://docs.mongodb.com/manual/tutorial/enable-authentication/