When we try to retrieve related records using ArcGIS Server's queryRelatedRecords endpoint, our clients sometimes receive an odd error message. It's just "json". This is really hard to diagnose. Any ideas on what it might be alluding to? What JSON is it talking about?
Greetings Jeremy,
It sounds as if the client is truncating the error message. Can you query the logs within ArcGIS Server?
The JSON referenced here is simply a response to the REST API call created by your query of the related records. If we submitted the same request directly within the REST endpoint, I bet we would get the full text of the error or response.
This documentation may help in giving context to how these requests operate:
https://developers.arcgis.com/rest/services-reference/query-feature-service-.htm
How do I check the ArcGIS Server logs?
https://enterprise.arcgis.com/en/server/10.6/administer/windows/work-with-server-logs.htm
I hope this helps!
Runtime is calling Server in this case. So, it shouldn't be truncating the message. The entire message is "json". So, it seems you saying that Runtime is structuring the REST call incorrectly. Unfortunately, because the error doesn't give me enough information to know how the call is incorrect, I have very little I can do. Are there certain cases in which Server would just reply with "json"?
Hi Jeremy,
I am sorry to say I have never seen this response in an error message. However, we may be able to utilize some tools to get more information.
The first thing I would try (if possible) is to capture network traffic when this request is made. The second thing I would take a look at are the Server logs just like Jonathan suggested below.
Lastly, when I am faced with a situation where the error message is not giving me the information I need, I try to think of a different way I can replicate the call. Can we try reproducing this same call directly at REST? Or even switch the client out for a different one?
I know it is tedious, but what we really need is more information about what is causing the mysterious "JSON' error.
I hope this is helpful.
If you can reproduce the error in the REST API directly, then it wouldn't be a parsing problem, at least by the client. To me, it sounds like the Server is expecting JSON, but isn't receiving it, and the error isn't clear. Set the Server logs to DEBUG and try again, they may indicate what's going on to throw the error.
We receive these errors from telemetry we gather from our Runtime application. Because this is at client sites, we have very little visibility into the details until they start a ticket. This has not happened yet. But, it seems likely that we'll get the case soon. When we do, I can provide any other diagnosis info we can gather.
My hope here was to gain some initial insight from those who know the underlying code of Server and could speak to why it would give this error message. I'm interested in any speculation here. Can we at least be assured that Server is looking for particular content in json and didn't receive it? Or could such an error mean that it received something else (like xml) when it was expecting json?