ArcGIS server 10.1 rest api queries fail inconsistently

5580
7
03-02-2015 02:11 PM
karenpayne
New Contributor

Apologies for posting this both here and GIS.stackExchange (ArcGIS server 10.1 rest api queries fail inconsistently - Geographic Information Systems Stack Excha...

I have a set of Map and Esri Feature Services running on a 10.1 ArcGIS Server, with SQL Server in the back end.

When I query the layers for either the geometry or OIDs using the rest interface, the query only works in certain instances.

  1. If I query a point layer the result works as expected and I get the data
  2. If I query a polygon layer like this, it fails: http://gistmapsdev.itos.uga.edu/arcgis/rest/services/COD_External/SYR_AR_DynamicLabeling/FeatureServ...

I get the error message

{"error":{"code":400,"message":"Unable
to complete operation.","details":["Unable to perform query
operation."]}}

The server log files show: Database error:

Operation without query criteria is not allowed.

However this query (same service, different polygon layer) works as expected and returns the feature geometry:

http://gistmapsdev.itos.uga.edu/arcgis/rest/services/COD_External/SYR_AR_DynamicLabeling/FeatureServ...

There are 2 polygon layers that I can query and get the expected result but all other polygon layers fail and for the life of me I cannot see any difference in the properties of the feature classes that fail vs those that do not.

If I dirty the query (by adding a where clause 1=1) I get the expected result; so for example, this query works:

http://gistmapsdev.itos.uga.edu/arcgis/rest/services/COD_External/SYR_AR_DynamicLabeling/FeatureServ...

What I’ve looked at:

    1. I have not hit the max feature limit set on the server or the service
    2. the behavior is consistent across browsers
    3. the behavior is consistent using either get or post
    4. I have rebuilt the spatial indices
    5. The behavior is consistent if I ask for json or html response

I’d be grateful for any pointers or areas that I should look at.

Thanks in advance!

Message was edited by: Asrujit SenGupta

0 Kudos
7 Replies
XanderBakker
Esri Esteemed Contributor

Strange, all 3 URL's posted return a valid result for me...

karenpayne
New Contributor

Now that's interesting thanks Xander! I'll work on our outside tester this morning.

0 Kudos
karenpayne
New Contributor
0 Kudos
XanderBakker
Esri Esteemed Contributor

That URL indeed does not work (although I'm using a different network than yesterday).

I though this might be due to specifying the geometryType parameter without specifying a geometry, but when I remove it, it still does not work. When adding the 1=1 as whereclause it does work... (as you said).

0 Kudos
XanderBakker
Esri Esteemed Contributor

I see that you are using ArcGIS for Server 10.1 SP1. If I use the query on a service here using the exact same parameters it throws me this error:

{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}

Different from yours, but still an error. I think you can best include the where clause 1=1 or using a random number (random number = random number) to avoid it.

In case you don't want to specify a where clause you can still use the geometry with an envelope that covers the area:

http://gistmapsdev.itos.uga.edu/arcgis/rest/services/COD_External/SYR_AR_DynamicLabeling/FeatureServ...

karenpayne
New Contributor

Thanks for looking at this Xander. Interesting workaround with the envelope; that's good to know.  thanks again,

0 Kudos
BrianMcAuslan
New Contributor III

my error

{"error":{"code":400,"message":"Invalid or missing input parameters.","details":[]}}

however 1=1 worked for me. thx

not sure if related to the error i was getting but found one of the geometry features had no coords

{
"attributes": {
"Name": "sample"
},
"geometry": {
"rings": [

]
}

0 Kudos