Select to view content in your preferred language

Connection to AGOL Exception

2648
8
Jump to solution
06-20-2024 05:36 AM
BrianLeroux
Frequent Contributor

I have a script i have been using for the past 6 months that connects to AGOL and copies content into my Portal. Today the script is unable to connect to AGOL. The script connects using gis = GIS(url="https://amica.maps.arcgis.com/home",username="myUN",password="myPW"). 

Exception                                 Traceback (most recent call last)
In  [9]:
Line 1:     gis = GIS(url="https://amica.maps.arcgis.com/home",username="myUN",password="myPW")

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 637:   raise e

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\__init__.py, in __init__:
Line 576:   self._portal = _portalpy.Portal(

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in __init__:
Line 237:   self.get_properties(True)

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1312:  raise e

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\_impl\_portalpy.py, in get_properties:
Line 1292:  resp = self.con.post(path, self._postdata(), ssl=True)

File C:\Users\A10713\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone-1\Lib\site-packages\arcgis\gis\_impl\_con\_connection.py, in post:
Line 1517:  raise Exception("A general error occurred: %s" % e)

Exception: A general error occurred: maximum recursion depth exceeded while calling a Python object

 When I check in Fiddler I see the following message for the request. 

"After the client received notice of the established CONNECT, it failed to send any data."

Any ideas?

0 Kudos
1 Solution

Accepted Solutions
PierreloupDucroix
Frequent Contributor

Hello,

you can take a look here : https://community.esri.com/t5/arcgis-utility-network-questions/install-untools-breaks-arcgis-gis-con...

I posted there because it was related to Utility Network package installation, but it may be more common.

Problem -> You need requests >=2.30.0,<2.32.0

Solution -> pip install requests==2.31.0 on the cloned environment

CEO of MAGIS

View solution in original post

8 Replies
BrianLeroux
Frequent Contributor

Oddly enough I was able to connect after changing my python package manager active environment back to the default arcgispro-py3 environment. I was using a clone as I needed a couple additional packages for another project. Not sure why the clone would block the connection to AGOL.

0 Kudos
PierreloupDucroix
Frequent Contributor

Hello,

I have the same error since I upgraded to pro 3.3, do you have the same version ?

CEO of MAGIS
0 Kudos
CarlVricella
Regular Contributor

Same issue since upgrading to 3.3. **bleep** ESRI, every time something gets updated; QC must be non-existent there. 

0 Kudos
ericsamson_tract
Frequent Contributor

Currently experiencing the same thing in a dockerized container for arcgis version: 2.2.0.1

I have not found a solution yet.

0 Kudos
PierreloupDucroix
Frequent Contributor

Hello,

you can take a look here : https://community.esri.com/t5/arcgis-utility-network-questions/install-untools-breaks-arcgis-gis-con...

I posted there because it was related to Utility Network package installation, but it may be more common.

Problem -> You need requests >=2.30.0,<2.32.0

Solution -> pip install requests==2.31.0 on the cloned environment

CEO of MAGIS
BrianLeroux
Frequent Contributor

That was the issue. Thanks for sharing.

0 Kudos
JCGuarneri
Frequent Contributor

I've attempted this fix, but It stays on the same requests version. Is there something I'm missing?

0 Kudos
RogerDunnGIS
Frequent Contributor

For anyone wondering how to do this, this is what I did.

  1. In ArcGIS Pro, Project > Package Manager
  2. Click the gear in the upper right-hand corner
  3. In the ensuing dialog, highlight and copy the path to the active environment
  4. Close ArcGIS Pro
  5. Open Command Prompt
  6. cd "(pasted path)"
  7. cd Scripts
  8. Copy and paste the pip command from this thread into Command Prompt
  9. You should see a success message that the newer one is uninstalled and old, working one installed

 

0 Kudos