We are experiencing a production issue with a long-running Survey123 survey whose parent hosted feature layer contains 907 fields and currently has approximately 503 records.
The survey and feature layer worked previously, but multiple Survey123 and ArcGIS Online functions recently began failing with the following error:
Cannot perform query. Invalid query parameters.
'SQL query is nested too deeply. Rewrite the query or break it up
into smaller queries.' parameter is invalid
Error Code: 400We performed controlled testing through the ArcGIS REST Services Directory to isolate the problem.
Test settings:
where=1=1
returnGeometry=false
resultRecordCount=1
Request method=POSTResults:
796 explicitly requested fields = succeeds
797 explicitly requested fields = fails
907 fields / outFields=* = failsWe tested multiple different field combinations rather than only the first fields in the schema.
The following all succeeded:
Multiple different combinations containing exactly 797 fields failed with the same nested-SQL error.
We also tested the field located at position 797:
Therefore, we have not identified a particular defective field. The failure appears to be based on the total number of requested fields.
Inbox refresh fails with:
Cannot perform query.
Invalid query parameters.
Code 400We tested two different Field App versions, and both produced the same result:
Survey123 Field App 3.1
Survey123 Field App 3.25The Survey123 Data page recognizes the record count and displays approximately:
503/503However, the attribute table is blank. Because the rows contain no visible data, records cannot be selected for report generation.
The parent-layer geometries and record count load, but the attribute table is blank.
Using Chrome Developer Tools, we confirmed the attribute table sends this query:
where=1=1
outFields=*
returnGeometry=false
resultRecordCount=50
f=pbfBecause outFields=* requests all 907 fields, the table does not populate.
A configured Map Viewer pop-up still works. We captured its requested field list and confirmed that it requests only 201 fields, not all 907.
A report request for one specific record was submitted successfully and received a valid job ID. The job then failed during preparation:
jobStatus: esriJobFailed
detailedStatus: prepareFailed
progress: 0The report request was limited to one ObjectID:
"queryParameters": { "objectIds": "5068"}
The returned message was:
An error occurred when querying data from the feature layer.
400: Cannot perform query. Invalid query parameters.
'SQL query is nested too deeply. Rewrite the query or break it up
into smaller queries.' parameter is invalidThis occurred before the Word document was created.
A custom Python export process also failed while querying the same single parent record with:
ft.query( where="objectid=5068", out_fields="*", return_geometry=False)
The ArcGIS API for Python returned the same Code 400 and nested-SQL error.
Changing the Python process so it requests only the ObjectID and GlobalID allows it to avoid that specific full-width query.
| REST query | 796 | Succeeds |
| REST query | 797 | Fails |
| REST query | * / 907 | Fails |
| Map Viewer pop-up | 201 | Succeeds |
| Map Viewer attribute table | * / 907 | Blank |
| Survey123 Data page | Full parent schema | Blank |
| Survey123 Inbox | Full parent schema | Code 400 |
| Feature Report for one ObjectID | Full parent record preparation | Fails |
| Python query with out_fields="*" | 907 | Fails |
At this time, the only confirmed distinction is that operations requesting a limited field list continue to work, while operations requesting 797 or more fields fail.
Hey, I also noticed this issue on a survey123 with a similar number of fields as yourself. I believe something has changed on the backend that is causing this issue for services with close to a 1000 columns.
Hey @ChristopherVan_de_Wyngard @abdhassa24,
Thank you for reporting this! There was a fix applied to ArcGIS Online last night that addresses this issue. Testing on our end we're no longer able to reproduce in our sample ArcGIS Online org.
Are you still seeing the issue on your end?
Thank you, Zach. As always, I truly appreciate the excellent work you and the ESRI team do. Thank you very much for looking into this issue and getting it resolved. After the fix was implemented, we confirmed that the issue is now resolved on our end as well.