Why did my query fail?
You can find the status of a failed query in the Query Monitor. When errors or exceptions occur, the ExceptionDetails column provides relevant information (hover over the cell to display the full details, or right-click and select "Show Exception" to open the message in a dialog window).
There are three primary causes of query failure:
- It failed to initialize, most likely due to an error in the script. The ExceptionDetails column will pinpoint the first line where it encounters a problem, such as a missing quotation mark or an incorrect import path. A query may also fail to initialize because starting a new query exceeds the query server's maximum heap size. The DataRatio column shows an approximation of how much of the heap size is being used by the query.
- An error occurred after it was initialized (e.g., processing incremental updates)
- It disconnected from the server. See Query failure due to server connection.
You can also query the PersistentQueryStateLog in DbInternal; the following command will return information about all persistent queries currently in a failure state:
pqslCurrentFailedStates = db.i("DbInternal","PersistentQueryStateLog")
.where("Date=currentDateNy()")
.lastBy("SerialNumber")
.where("Status in `Failed`, `Error`, `Disconnected`")
pqslCurrentFailedStates = db.i("DbInternal","PersistentQueryStateLog")\
.where("Date=currentDateNy()")\
.lastBy("SerialNumber")\
.where("Status in `Failed`, `Error`, `Disconnected`")
To learn more about diagnosing query and troubleshooting solutions, see our Troubleshooting Queries guide.