Select to view content in your preferred language

definition query breaks with proxy setup

3750
6
10-29-2014 02:55 PM
melodiking
New Contributor III

I have a definition query on a feature service hosted on ArcGIS Online that breaks when I set up up a proxy and can't figure it what is causing it to break.

Proxy page was setup according to instructions enclosed in the Esri proxy github folder (see: Esri/resource-proxy · GitHub ).

Feature layers load fine using proxy with multiple projects.

When query string is short, proxy send a GET request. No problem.

When query is longer than 2048 characters, proxy sends a POST request.

This makes sense.  My understanding is that one of the benefits of setting up a proxy page is so that you can send longer requests (see: Using the proxy | Guide | ArcGIS API for JavaScript )

I get the following error in my console:

"Error: Cannot perform query. Invalid query parameters. {code: 400, message: "Cannot perform query. Invalid query parameters.", details: Array[1], log: undefined, httpCode: 400…}_ssl: undefinedcode: 400details: Array[1]0: "'geometry' parameter is invalid"length: 1__proto__: Array[0]httpCode: 400log: undefinedmessage: "Unable to draw graphic (null): Cannot perform query. Invalid query parameters."stack: (...)get stack: function () { [native code] }set stack: function () { [native code] }__proto__: d...."

Tags (2)
0 Kudos
6 Replies
BjornSvensson
Esri Regular Contributor

Melo, did you get this to work?

If you get back "Invalid query parameters", did you try going to the HTML rest endpoint and using the same query parameters?  If so, could you share the actual proxied request that fails with POST?  Is the service public? 

0 Kudos
melodiking
New Contributor III

No, the issue hasn’t been resolved.  I have a support case open (#01579392) and have been troubleshooting with Jesvin off and on for the past week with no luck.

Yes.  I’ve tried submitting the same statement through the rest endpoint as a POST request and I receive the expected results.  Attached is the request and response error being generated.

Unfortunately, the service is not public.  I’m trying to set up the proxy page locally before I push it to the live (but unpublicized) site.

0 Kudos
melodiking
New Contributor III

I made a temporary public feature service with a subset of the data (http://services.arcgis.com/o6oETlrWetREI1A2/arcgis/rest/services/WhalemAPP_Sample_SEAK/FeatureServer... ).  The only other difference between this feature service and the secured version is the DATE field is replaced with DATE_.

An issue was submitted on the github page by the tech support person I am working with at Esri (PHP: failed to send over long where statement · Issue #162 · Esri/resource-proxy · GitHub ). 

The query works through REST, without a proxy, and with a dotnet proxy. 

It doesn't work with the PHP proxy.

You can use the following request:

(SpeciesCategory = 3 OR SpeciesCategory = 1 OR SpeciesCategory = 2 OR SpeciesCategory = 4) AND (DATE_>='2013-10-26 00:00:00' AND DATE_<='2014-11-17 23:59:59') AND ("TRACK_UNIQUE_ID" LIKE '%0000000000%' OR "TRACK_UNIQUE_ID" LIKE '%p6Cw0FmTuK%' OR "TRACK_UNIQUE_ID" LIKE '%Q8ZuEOnYlX%' OR "TRACK_UNIQUE_ID" LIKE '%64sbJ3Efqi%' OR "TRACK_UNIQUE_ID" LIKE '%KK82pGgvTO%' OR "TRACK_UNIQUE_ID" LIKE '%AxCDOQ87zs%' OR "TRACK_UNIQUE_ID" LIKE '%QEOa05IBHD%' OR "TRACK_UNIQUE_ID" LIKE '%1XB5ddFFCu%' OR "TRACK_UNIQUE_ID" LIKE '%0J46FUmYM0%' OR "TRACK_UNIQUE_ID" LIKE '%JVT1rdsbCb%' OR "TRACK_UNIQUE_ID" LIKE '%oZKZZau6FI%' OR "TRACK_UNIQUE_ID" LIKE '%dhRjg3G1N5%' OR "TRACK_UNIQUE_ID" LIKE '%e5g4YE8KkI%' OR "TRACK_UNIQUE_ID" LIKE '%epq1XNlYmy%' OR "TRACK_UNIQUE_ID" LIKE '%I3QUbYLMnG%' OR "TRACK_UNIQUE_ID" LIKE '%jnEtJHkM7i%' OR "TRACK_UNIQUE_ID" LIKE '%Dbxd3B9BFU%' OR "TRACK_UNIQUE_ID" LIKE '%yJUxiivTci%' OR "TRACK_UNIQUE_ID" LIKE '%hxnIjt1ta9%' OR "TRACK_UNIQUE_ID" LIKE '%6TeAUGsyts%' OR "TRACK_UNIQUE_ID" LIKE '%F7C1vp1ifg%' OR "TRACK_UNIQUE_ID" LIKE '%iYAqMYYZ6N%' OR "TRACK_UNIQUE_ID" LIKE '%LEaMLyVDTB%' OR "TRACK_UNIQUE_ID" LIKE '%2l0Al4m5Rm%' OR "TRACK_UNIQUE_ID" LIKE '%KmAPpW02Gf%' OR "TRACK_UNIQUE_ID" LIKE '%ArWZcTjvuW%' OR "TRACK_UNIQUE_ID" LIKE '%WH2KHsdwxA%' OR "TRACK_UNIQUE_ID" LIKE '%6g0fDiHyS4%' OR "TRACK_UNIQUE_ID" LIKE '%nBHpPhaI0c%' OR "TRACK_UNIQUE_ID" LIKE '%Zmo3nvj6qW%' OR "TRACK_UNIQUE_ID" LIKE '%vttTn2Rlcu%')

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Bjorn, I am now working with Melo in this case. I can reproduce this issue PHP: failed to send over long where statement · Issue #162 · Esri/resource-proxy · GitHub

0 Kudos
melodiking
New Contributor III

There seems to be a few issues going on.  We think we've figured out a temporary work around.

Erwin discovered that commenting out this line of code on his local server resolved the issue:

resource-proxy/proxy.php at master · Esri/resource-proxy · GitHub

Using a tester application on several machines, I found that his solution works on servers that have a newer version of curl.  Each of the machines passed each of the verification tests recommended in the proxy instructions.

LOCALHOST/tester

works: NO

PHP: 5.3.5
curl: 7.21.3

WHALEMAPP.ORG/tester

works: NO
PHP: 5.3.24
curl: 7.19.7
WORKS: no

MELOKING.COM/tester
works: YES

curl: 7.24
PHP:5.3.10

erwin’s tester
works: YES

PHP: 5.5.14
CURL: 7.37

This is a great work around, assuming that my production server has the proper version of curl installed.  However, unfortunately, that does not seem to be the case for me as the production site is hosted via godaddy.

0 Kudos
melodiking
New Contributor III

I've closed the case with Esri unresolved.  There is currently not a work around for lower versions of curl.  The issue has been reported to the proxy team and there is an open issue for it on Github.  Follow the repo if you want to stay informed.

Esri/resource-proxy · GitHub

0 Kudos