Etags and Intermittent QueryTask Server Errors

2133
4
12-05-2012 04:56 PM
DouglasHall
New Contributor III
Using jsapi 3.2 and server 10.11, running a simple intersection queryTask on a polygon AGSDynamicService, see below, and it fails half of the time with HTTP 200 and response payload {"error":{"code":400,"message":"Unable to complete operation.","details":[]}}

Has anyone been having a similar problem? Do these Etags make sense? I'm keying in on the Etag strangeness because it seems like I should be getting 304 not modifieds when Etags are available or at least the whole response again -- not errors.

var query = new esri.tasks.Query(),
    queryTask = new esri.tasks.QueryTask(SERVICE_PATH_OPERATIONAL_MAP);

query.geometry = mapPoint;
query.outFields = ["DAC", "MHI", "GEOID10"];
queryTask.execute(query, function (res) {
    //do something
}, function (err) {
    alert(err.message);
});


Here's the series of events:
----------------------------
1. Clear browser cache
2. a. Send request with query
    b. Get 200 response with GOOD answer and Etag 1346882992
3. a. Send request with same query and If-None-Match 1346882992
    b. Get 200 response with ERROR answer and Etag bdb51271
4. a. Send request with same query and If-None-Match bdb51271
    b. Get 200 response with GOOD answer and Etag 1346882992
5. a. Send request with same query and If-None-Match 1346882992
    b. Get 200 response with ERROR answer and Etag bdb51271
6. a. Send request with same query and If-None-Match bdb51271
    b. Get 200 response with GOOD answer and Etag 1346882992
7. a. Send request with same query and If-None-Match 1346882992
    b. Get 200 response with ERROR answer and Etag bdb51271
  
Using wikipedia for how Etags should generally work? http://en.wikipedia.org/wiki/HTTP_ETag

Thanks for your help!
4 Replies
derekswingley1
Frequent Contributor
I've seen something similar once previously but with an async GP service instead of a query task. I don't currently have a fix or a good work around.

Is there a public URL for your service?
0 Kudos
DouglasHall
New Contributor III
No it's not a public service... maybe I'll try and get it through the firewall and repost the question.
0 Kudos
derekswingley1
Frequent Contributor
This looks like it's NIM086349 which was introduced with service pack 1 for ArcGIS Server 10.1. Can you open a call with support and request to be added to this bug?
0 Kudos
ZachLiu1
Occasional Contributor II
I hit the same issue and I found this thread,

the request is like:
success,
fail,
success,
fail,
......

I am using this work around:

because queryTask.execute() accept the third parameter as err handling function, I insert the function to call queryTask.execute() again in it and it works almost all the time.

Any other ideas?