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!
Solved! Go to Solution.
Hmm. Smells really familiar. I recently worked with someone whose 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).
Hmm. Smells really familiar. I recently worked with someone whose 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).
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.
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:
IIS Restart seems to be required for this config change to stick, so we'll be doing it over the weekend to avoid downtime.
You're my hero, thanks for posting exactly where to look! Was able to fix my issue
Is it possible to restructure your query and trim it down a bit?
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.
We're encountering this same issue. In our case, it's the IIS request filtering's maximum query length (2048 bytes) that is the issue... a REST API query, beginning at the word 'query' of 2043 characters works, and at 2052 characters we get 404 file/folder not found 😬
Our solution has typically been to write our custom applications to send the queries in batches.
I have not seen any recommendations from Esri on what these parameters should be, only that there is an Esri support article on how to update them (which seems outdated).
Have any of you tried adjusting these parameters? Have you found values that work? Was there any performance impact?