marklogicmarklogic-9

How to find out the bad query that resulted into cluster restart?


How do I find the query possibly from query console?

I know the time period.

It is not available in history dashboard as in history dashboard. I can see long running queries for the last 10 minutes only.

Perhaps if I could get the right URI exploring App-Serives or meters data?


Solution

  • If you want to see what queries were executed in Query Console, check the 8000_AccessLog.txt entries in that timeframe and look for POST to the /qconsole/endpoints/evaler.xqy endpoint.

    For example:

    ::1 - admin [20/Jun/2020:18:51:34 -0400] "POST /qconsole/endpoints/evaler.xqy?qid=4765025502384248875&dbid=10248170186042536325&sid=11969990273495629802&crid=6539177331&querytype=xquery&action=eval&cache=1592693494327 HTTP/1.1" 200 226 "http://localhost:8000/qconsole/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36"

    Grab the qid (in the example above, it is 4765025502384248875

    Then you can find that query in the App-Services database by constructing a URI with that ID:

    doc("/queries/4765025502384248875.txt")