Getting WinErrors 10060 and 10054 when using ArcGIS API for Python against Portal 10.6.1

148
2
06-02-2020 05:40 AM
Highlighted
by
New Contributor III

Hey all,

We've been struggling with an issue for about a week now and wanted to hopefully reach out to the GeoNet community to see if anyone else has experienced it or has ideas on how to narrow this down further.

I've attached a very simple Python script that reproduces the issue for us, along with the traceback error, but the script is not the issue here. Everything was running successfully before, and pretty much any script we have that hits our Portal reproduces the WinErrors. 

Some notes on this issue:

  • Issue started happening suddenly as of Sunday last week (5/24). Before then, all scripts were running with no issues.
  • Happens with essentially all of our Python scripts that use the ArcGIS API for Python to hit our production or pre-production Portals (hosted in same environment). Development and Staging are unaffected (hosted in different environment).
  • Get either WinError 10060 or 10054
  • Making the same requests directly to the REST end-points are successful, issue only occurs when making these requests through Python
  • It seems like “simpler” requests are successful sometimes for us. In the attached example, if we set “max_items” to “1”, the script is typically successful. Setting this to higher values like the max of “10000” leads to the connection error. We need these values set high due to the size of our Portal but we are not exceeding any Python limitations, especially since everything ran fine before with same code.
  • Sometimes it will error out before the connection is even made (line gis = GIS(portalurl,username,password), sometimes it will pass the connection and then fail out half-way through making the batch of content.search requests.
  • Everything runs successfully when the scripts reference the Portal’s FQDN and are ran internally. Scripts fail when using the public/external URL as shown in the example, even when ran internally on server machines.

 

We tested to set up Fiddler today on our Portal machine to act as a forward proxy and hopefully log more information regarding where the failure was coming from, but this was unsuccessful. Essentially we need help narrowing this down to prove that the issue is either coming from a networking/environment standpoint or from an ArcGIS/Python standpoint.

Thank you all for your help.

Reply
0 Kudos
2 Replies
Highlighted
by
New Contributor III
Reply
0 Kudos
Highlighted
Esri Contributor

I upgraded to the latest version of the ArcGIS Python API and added the following garbage collection code to my script:

import gc

 

#every time before I upload something

gc.collect()

From some research I did it seems like Python wants to put the entire file into memory before uploading it, and occasionally this can cause the error...  

So far so good with this kludge but we'll see.

FYI similar issue here ->  Python Script Error 10054 Connection abort 

Reply
0 Kudos