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!
Any chance it is hitting secure services that you don't have proper credentials? Just a guess, I haven't fully deciphered your script.
Nope, it's definitely not a credential problem.
I have the same issue. At 10,000 features it worked great. Not at 32,000 and it dies with the same error as you.
Try:
'expiration': 60,
in your credentials. i.e. an integer, not a string.
It looks like the token is timing out. You have to manage token lifecycle.
This is a whole lot easier in ArcGIS Pro.
Regards
Thanks but where do I put this? No idea where to add that.
Opps thought this was from REST. Here is the code where do I add that?
#Get a local replica of the HFS
proxy_port = None
proxy_url = None
agolSH = AGOLTokenSecurityHandler(username=username,password=password)
fs = FeatureService(url=url,securityHandler=agolSH,proxy_port=proxy_port,proxy_url=proxy_url,initialize=True)
result = fs.createReplica(replicaName='Demo', layers='0,1,2,3', keep_replica=False, layerQueries=None, geometryFilter=None, returnAttachments=True,returnAttachmentDatabyURL=False,returnAsFeatureClass=True, out_path=outDir)
Line 139, in the file downloaded.
As written it was '60', not 60.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.