parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

MongoError: "Encountered exception while executing Javascript. Query root must be specified."

Open adambarghouthi opened this issue 9 years ago • 30 comments

Hi guys,

I have my parse server on Azure now and everything has been working great for a month. Just today when Parse shut down I'm getting this error in my server console:

Error generating response. { [MongoError: Message: {"Errors":["Encountered exception while executing Javascript. Exception = Error: Invalid argument. Query root must be specified.\r\nStack trace: Error: Invalid argument. Query root must be specified.\n   at commonUpdate (__.sys.commonUpdate.js:2288:17)\n   at __docDbMain (__.sys.commonUpdate.js:4:5)\n   at Global code (__.sys.commonUpdate.js:1:2)"]}

Don't know what the problem is. What I've done so far:

  • I changed SERVER_URL field in CoreManager.js from https://api.parse.com/1 to my Azure server url

Hope someone has a solution and has encountered it before, thank you!

adambarghouthi avatar Feb 01 '17 05:02 adambarghouthi

I've the exact same problem ! I'also host my parse server on azure and everything worked without problems until now. but today I'get the following error

Uncaught internal server error. { [MongoError: Message: {"Errors":["Encountered exception while executing Javascript. Exception = Error: Invalid argument. Query root must be specified.\r\nStack trace: Error: Invalid argument. Query root must be specified

michael-mansour avatar Feb 01 '17 08:02 michael-mansour

Looks like it's an azure related issue. Can you try downgrading parse-sever or mongodb. Or look if there are known issues with the latests mongodb versions and azure's DocumentDB (I assume you're using azure's database)

flovilmart avatar Feb 01 '17 12:02 flovilmart

Yes I use azure DocumentDB. What I do not understand is that the problem has appeared suddenly on a release (2.3.1) that has worked well until now

michael-mansour avatar Feb 01 '17 13:02 michael-mansour

Uhm, that's odd indeed. But I have never seen that error before. Does that error occur on every queries?

flovilmart avatar Feb 01 '17 13:02 flovilmart

No only when I'try to "modify" an existing object

michael-mansour avatar Feb 01 '17 13:02 michael-mansour

Can you get in touch with Azure support? Their mongodb driver compatibility is hidden, and I don't recognize those errors.

Also, __docDbMain hints to DocumentDB issue :)

flovilmart avatar Feb 01 '17 13:02 flovilmart

I've create an issue here https://github.com/felixrieseberg/parse-server-azure/issues/13

michael-mansour avatar Feb 01 '17 13:02 michael-mansour

@skynext what release 2.3.1 are you talking about? The parse server version?

adambarghouthi avatar Feb 01 '17 14:02 adambarghouthi

@adambarghouthi yes the problem first appeared on parse server version 2.3.1 (while I had no problems with this version until then) I've update parse server to 2.3.2 but the problem persists

michael-mansour avatar Feb 01 '17 14:02 michael-mansour

@skynext On my iOS app I'm seeing this error in the console of XCode {"code":1,"message":"Internal server error."}, looking around some people who encountered this general message said that there might be something wrong with Express version. What do you think?

adambarghouthi avatar Feb 01 '17 14:02 adambarghouthi

I get the exact same error !

fatal error: 'try!' expression unexpectedly raised an error: Error Domain=Parse Code=1 "{"code":1,"message":"Internal server error."}"

Honestly I do not know, I do not see how the logs on the servers involve the express version. Just like @flovilmart suggests I've contacted the Azure support via stackoverflow http://stackoverflow.com/questions/41981297/mongoerror-encountered-exception-while-executing-javascript-query-root-must-b?noredirect=1#comment71142563_41981297 I m waiting for their answers

michael-mansour avatar Feb 01 '17 14:02 michael-mansour

CAN you downgrade to 2.3.0 and see if the problem persists?

flovilmart avatar Feb 01 '17 15:02 flovilmart

Ok I will try ! Can you please very quickly explain me (or just give me a link) how can I downgrade parse server version on azure ? Thank you very much

michael-mansour avatar Feb 01 '17 15:02 michael-mansour

@skynext

npm install packageName@versionNum --save --save-exact in the console of the cloud code portal

adambarghouthi avatar Feb 01 '17 15:02 adambarghouthi

Another option would be to try with :latest as explained in as explained here it contains an updated version of the mongodb npm package

flovilmart avatar Feb 01 '17 15:02 flovilmart

I'm contacting Azure support about this now since I've seen the same issue with no changes to our server side in weeks.

oproulx avatar Feb 01 '17 15:02 oproulx

The Azure team is looking into it.

oproulx avatar Feb 01 '17 15:02 oproulx

@oproulx Thanks man!

adambarghouthi avatar Feb 01 '17 15:02 adambarghouthi

@skynext any update?

adambarghouthi avatar Feb 01 '17 16:02 adambarghouthi

None yet. They've been pretty responsive in the past though.

oproulx avatar Feb 01 '17 16:02 oproulx