Select to view content in your preferred language

REST API - No JSON Object could be decoded

6366
10
05-22-2015 03:05 AM
TrilliumLevine1
Occasional Contributor

Hello All,

I have a script that I'm using to download services as a geodatabase using the REST api.  It works about half the time -- the other half the time I get a 500 error stemming from a 'No JSON object could be decoded' error.  Anyone have any idea why this might be happening?  I don't think it's a bug in my script, since it works sometimes, but I've attached it in case anyone has any ideas and wants to see how it's put together.  Any feedback is greatly appreciated!

Tags (2)
0 Kudos
10 Replies
DougBrowning
MVP Esteemed Contributor

I am pretty sure it is JSON being returned since

1.  I have ran this script 20+ times just fine when there were less records.

2.  I can take some of the layers out and it works fine.  It crashes between 33,517 and 34,178 records. 

3.  I can also download any layer by itself with no issues so not a data issue.

This does have definition queries in it which I noticed split the data into different layers when publishing to AGO then combines then back together when bringing down a replica.  Not sure if that matters but wanted to mention it.

I also am not sure it is a timeout issue as it does not take very long to do all but one of the layers (which is just 661 records).  I can do any combination of layers 0-4 just not all of them at once.  If I go into AGO and ask for a JSON file the file I get is 66 MB.  Seems high since there are only 5 fields in each layer.

Thanks a lot