Getting error something of this sort when accessing MongoDB. Any clue?
QueryFailure flag was unauthorized db:monza lock type:-1 client:10.173.78.216 (response was { "$err" : "unauthorized db:monza lock type:-1 client:10.173.78.216", "code" : 10057 }).
Related
The Query:
db.products.updateOne(
{"name":"pen"},
{$set : { "stock" : 32}},
)
I got this error:
uncaught exception: SyntaxError: illegal character :
Try to change $set with "$set". Also, enter the code in the question instead of putting images.
I have this issue with my meteor app. When I run this query on my chrome console, It returns the expected data
Questions.find({}, {sort:{commentLength: -1}})
but when I run it in the console as db.questions.find({}, {sort:{commentLength: -1}})
it returns this error
error: {
"$err" : "Can't canonicalize query: BadValue Unsupported projection option: sort: { commentLength: -1.0 }",
"code" : 17287
}
Why does this error happen? Thanks
sort has a different syntax when executed in a mongodb shell. Try this instead:
db.questions.find().sort({commentLength: -1})
I am using mongodb 3.0.2 and when I run "top" command :
> db.runCommand( { top: 1 } )
I got the following error message:
2015-06-01T16:36:52.886+0900 E QUERY Error: error: {
"$err" : "BSONObj size: 46060490 (0x2BED3CA) is invalid. Size must be between 0 and 16793600(16MB)",
"code" : 10334
}
at Error ()
at DBQuery.next (src/mongo/shell/query.js:259:15)
at DBCollection.findOne (src/mongo/shell/collection.js:189:22)
at DB.runCommand (src/mongo/shell/db.js:58:41)
at (shell):1:4 at src/mongo/shell/query.js:259
It means that I can't monitor any longer, doesn't it? Can you guys show me the way out, please.
Some additional info:
DB size: 143.996GB - with wiredtiger enable.
Replication set enable.
No profiling.
We have been having some problems where our mongo connection fails to allow us to get the database names from the DB.
We call the method:
com.mongodb.Mongo.getDatabaseNames()
And 1 out of 100 times, it throws the following exception:
Caused by: com.mongodb.CommandFailureException: { "serverUsed" : "localhost:27017" ,
"errmsg" : "exception: can't open database in a read lock. if db was just closed, consider retrying the query. might otherwise indicate an internal error" , "code" : 15927 , "ok" : 0.0}
at com.mongodb.CommandResult.getException(CommandResult.java:76)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:131)
at com.mongodb.Mongo.getDatabaseNames(Mongo.java:397)
Looking at the mongo code, the database is the internal admin database
public List<String> getDatabaseNames(){
BasicDBObject cmd = new BasicDBObject();
cmd.put("listDatabases", 1);
>>CommandResult res = getDB(ADMIN_DATABASE_NAME).command(cmd, getOptions());
res.throwOnError();
This database is not being deleted, but there are several other databases that could be deleted around this time.
Has anyone else had this problem?
I am getting the following error when I run:
db.printCollectionStats()
error: {
"$err" : "stale config on lazy receive :: caused by :: $err: \"[myzips.zips] shard version not ok in Client::Context: this shard contains versioned chunks for myzips.zips, but no version set in request ( ns : myzips.zip...\" ( ns : myzips.zips, received : 0|0||000000000000000000000000, wanted : 1|1||50fdd55b14faa2aa46422a7a, recv )",
"code" : 9996
} at src/mongo/shell/query.js:128
what does this mean?