Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.88k stars 1.1k forks source link

Upgrade from arcgis==1.8.5.post3 to arcgis==2.3.1 caused recursion error upon login? #2087

Open xaviernogueira opened 1 day ago

xaviernogueira commented 1 day ago

Describe the bug So I am upgrading all our packages in our project, including Python from 3.8 to 3.11. arcgis was upgraded, but is the one package causing us issues now, as we cannot login anymore withour username/password. We know the credentials are correct, as the 3.8 version of the code is currently deployed and running fine.

We see this bug on our Mac laptops, and in a micromamba image docker container.

To Reproduce Steps to reproduce the behavior:

from arcgis.gis import GIS
GIS(username="", password="")

error:

  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xaviernogueira/GitHub/data_ingestion/nifc/nifc/api.py", line 93, in ingest_data
    batch_import(latest_modified_location, now, perimeter=False, chunk_size=100)
  File "/Users/xaviernogueira/GitHub/data_ingestion/nifc/common/db_utils.py", line 119, in inner
    raise e
  File "/Users/xaviernogueira/GitHub/data_ingestion/nifc/common/db_utils.py", line 94, in inner
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xaviernogueira/GitHub/data_ingestion/nifc/nifc/io.py", line 130, in batch_import
    gis: GIS = get_gis_object()
               ^^^^^^^^^^^^^^^^
  File "/Users/xaviernogueira/GitHub/data_ingestion/nifc/nifc/io.py", line 33, in get_gis_object
    return GIS(
           ^^^^
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/__init__.py", line 637, in __init__
    raise e
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/__init__.py", line 576, in __init__
    self._portal = _portalpy.Portal(
                   ^^^^^^^^^^^^^^^^^
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/_impl/_portalpy.py", line 237, in __init__
    self.get_properties(True)
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/_impl/_portalpy.py", line 1312, in get_properties
    raise e
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/_impl/_portalpy.py", line 1292, in get_properties
    resp = self.con.post(path, self._postdata(), ssl=True)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/xaviernogueira/miniconda3/envs/data_ingestion_311/lib/python3.11/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1517, in post
    raise Exception("A general error occurred: %s" % e)
Exception: A general error occurred: maximum recursion depth exceeded

Platform (please complete the following information):

achapkowski commented 1 day ago

I mean that is basic stuff, so my question is, does micromamba install the normal libraries?

This GIS(username="", password="") connects to AGO with a username/password, and it works outside of this, so I guess a place to start is with posting a conda list of the environment.

xaviernogueira commented 1 day ago

So the thing is micromamba is in our container, but locally I am using normal conda.

It's a bit of a large environment (447 lines of conda list lol), do you mind providing me with some relevant libraries? I can show you the old and new version, could be a good way to isolate what changed.

Thank you!

achapkowski commented 12 hours ago

1.8.x is very old, compared to the 2.4.0 series. Put the conda list in a text file and attach it to the issue.