When trying to perform a query with Output Statistics against one of my MapServer endpoints I get an error in the query tool: "Unable to complete operation."
If I look at my logs I get a corresponding "General geodatabase error occured" error.
The endpoint data source is a Standalone Query Table which does not have any geometry/geography fields on SQL Server 2019.
Regular queries without outStatistics work fine. Please advise.
We are getting similar behaviour and find that restarting the service using server/manager provides a short-term fix.
Our config is a mix of new and legacy, Arc v11.0 with a registered datastore on SQLServer 2008R2 (!), with geometry stored as sdebinary(!!) and the service published using ArcPro v3.0.0.
Appears similar to Solved: Re: outStatistics return 'unable to complete opera... - Esri Community note that BUG-000092566: The Query task with output statistics fails on an Or.. (esri.com) is at "Will Not Be Addressed"
General form of a failure appears in the logs as:
<Msg ... type='FINE' code='10022' ... methodName='MapServerX::REST_Query' ... >Begin Query</Msg>
<Msg ... type='SEVERE' code='10837' ... methodName='QueryStatistics' ... >General geodatabase error occured.</Msg>
<Msg ... type='FINE' code='10023' ... methodName='MapServerX::REST_Query' ... >End Query</Msg>
whereas the general form of a successful call is:
<Msg ... type='FINE' code='10022' ... methodName='MapServerX::REST_Query' ... >Begin Query</Msg>
<Msg ... type='FINE' code='102025' ... methodName='SdeWorkspace.ReadOnlyConnection' ... >Set connection to read-only, enabling fast forward cursors.</Msg>
<Msg ... type='FINE' code='102026' ... methodName='SdeWorkspace.ReadOnlyConnection' ... >Unset connection from being read-only.</Msg>
<Msg ... type='FINE' code='10023' ... methodName='MapServerX::REST_Query' ... >End Query</Msg>