Hello all,
I remote into a machine and there is a proxy in use. I cannot access AGOL via the ArcGIS API for Python.
I try:
from arcgis.gis import GIS
agol = GIS("home")
or
agol = GIS(url="", username="", password="")
but I consistently get the following error.
ConnectionError: A connection error has occurred: HTTPSConnectionPool(host='xxx.maps.arcgis.com', port=443): Max retries exceeded with url: /sharing/rest/portals/self (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001B61ED92730>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
Note, I can access just fine without the proxy from my laptop, but I must complete work on the remote machine that has the proxy. So accessing AGOL is not the issue, it is overcoming the proxy.
Any ideas?
Cheers,
Solved! Go to Solution.
Hey, have you tried using the proxy parameter? I've heard mixed reviews, but hopefully your proxy is more forgiving:
# Usage Exmaple 9: Using a Proxy proxy = { 'http': 'http://10.10.1.10:3128', 'https': 'http://10.10.1.10:1080', } gis = GIS(proxy=proxy)
Hey, have you tried using the proxy parameter? I've heard mixed reviews, but hopefully your proxy is more forgiving:
# Usage Exmaple 9: Using a Proxy proxy = { 'http': 'http://10.10.1.10:3128', 'https': 'http://10.10.1.10:1080', } gis = GIS(proxy=proxy)
Hi @EarlMedina
Excellent, this approach worked. Here's what I was given, this failed to connect.
proxy = {
"http" : "http://**.***.*.**:XXXX"
}
This worked when I added the same information for the https key.
proxy = {
"http" : "http://**.***.*.**:XXXX",
"https" : "http://**.***.*.**:XXXX"
}
agol = GIS("home", proxy=proxy)
Thanks you!
I recently had to downgrade the urllib3 package to get my ArcGIS Python API to work correctly. Did you update your Python env recently?
Hi @jcarlson
It was not a recent upgrade, but thank you for your response. This is great to know and I will keep an eye out for this when upgrades happen. Earls solution above worked after testing dictionary configs.
@jcarlsonthanks for pointing this out. I'm building a new 11.4 replacement for a 10.9.1 environment and wrote a small script to find all items shared to a group in the old portal and share those same layers (by name) in a group in the new portal. I wrote the script in the 10.9.1 environment and it connects to both portals fine. When I copied that script to the 11.4 environment and tried running, it wouldn't connect to the 10.9.1 portal. This is likely why.
- Jack C.