sql where clause length limit? get request returns 404 error

2922
5
Jump to solution
04-26-2021 08:06 AM
PatSmyth
New Contributor III

Hi - We have a custom application filter that allows users to build complex queries and execute them again an ArcGIS REST API endpoint published to our federated ArcGIS enterprise environment. The functionality works fine for medium query strings (< 10 clauses). However, large query strings ( > 10 clauses) will intermittently throw a 404 File or Directory Not Found Error. We are executing said queries as a GET request as that is an application requirement at the moment. Is there a specified query length limit for GET requests against ArcGIS REST API endpoints? Is this documented anywhere? Thanks!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Hmm. Smells really familiar. I recently worked with someone who's IIS configuration blocked requests over a certain length (2130 characters - didn't matter if they were GET or POST). Requests over that length would resolve to 404s. And of course, that looked like an intermittent issue as queries got around the 2130 mark.

Can you check that your IIS configuration isn't doing the same? Once they fixed that, they were able to perform more complex queries. I never learnt why their IIS was configured that way, but it doesn't seem to be the default (note, this isn't really my wheelhouse, but this sounded familiar enough for me to throw this out there).

View solution in original post

5 Replies
Nicholas-Furness
Esri Regular Contributor

Hmm. Smells really familiar. I recently worked with someone who's IIS configuration blocked requests over a certain length (2130 characters - didn't matter if they were GET or POST). Requests over that length would resolve to 404s. And of course, that looked like an intermittent issue as queries got around the 2130 mark.

Can you check that your IIS configuration isn't doing the same? Once they fixed that, they were able to perform more complex queries. I never learnt why their IIS was configured that way, but it doesn't seem to be the default (note, this isn't really my wheelhouse, but this sounded familiar enough for me to throw this out there).

PatSmyth
New Contributor III

Thanks for this. I hadn't thought about IIS configs, but going to dig into and see if there is indeed a limit that is resulting in the 404s. 

0 Kudos
PatSmyth
New Contributor III

Found the setting in IIS that I believe will do the trick. Thanks for guiding me in the right direction!

For anyone out there with this issue: from the IIS site that hosts your arcgis server web adaptor(s) - note this may need also happen wherever portal web adaptors are as well, but in our case they are part of the same IIS Default site - do the following:

  • Select Request Filtering
  • Select Edit Request Filtering
  • Change default limits on Max Url Length and Max Query String 
    • there are wildly differing suggestion out there on what to change it too, in our case I'm going to try and get a handle on longest query string we're trying to pass and then set a nice cushion from that benchmark

IIS Restart seems to be required for this config change to stick, so we'll be doing it over the weekend to avoid downtime. 

 

0 Kudos
AndrewBowne
Occasional Contributor III

Is it possible to restructure your query and trim it down a bit?  

0 Kudos
PatSmyth
New Contributor III

this is what we did and we were able to get queries working again, however, we were still a bit irked by the non-descript 404 errors and by the fact that in the REST api spec there is no stated limit on query length as far as I now.