Error: __init__() got an unexpected keyword argument 'method_whitelist'

14304
12
05-05-2023 02:54 PM
RogerAsbury
Occasional Contributor

Pretty much this same question from someone else exists in another forum, but it has no answer. Figured I'd try my luck here. 🙂

I'm working on an Azure function app in Python that just queries a table in ArcGIS Online. It seems to build just fine, but when used it throws the error in the subject line at the point when it attempts to log in to ArcGIS Online.

Curious what might be the cause and solution. Below is the full error:

System.Private.CoreLib: Exception while executing function: Functions.getPercentages. System.Private.CoreLib: Result: Failure
Exception: TypeError: __init__() got an unexpected keyword argument 'method_whitelist'
Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 407, in _handle__invocation_request
call_result = await self._loop.run_in_executor(
File "C:\Python39\lib\concurrent\futures\thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 649, in _run_sync_func
return ExtensionManager.get_sync_invocation_wrapper(context,
File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.9/WINDOWS/X64\azure_functions_worker\extension.py", line 215, in _raw_invocation_wrapper
result = function(**args)
File "*****\getPercentages\__init__.py", line 34, in main
gis = GIS(url, user, pw)
File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 586, in __init__
raise e
File "*****\.venv\lib\site-packages\arcgis\gis\__init__.py", line 525, in __init__
self._portal = _portalpy.Portal(
File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_portalpy.py", line 208, in __init__
self.con = Connection(
File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 353, in __init__
self._create_session()
File "*****\.venv\lib\site-packages\arcgis\gis\_impl\_con\_connection.py", line 526, in _create_session
max_retries=Retry(
.

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
Tags (2)
0 Kudos
12 Replies
LorenzMeyer1
Occasional Contributor

What should be the order in the requirements.txt? First the arcgis 1.9.1 and then the urllib3 1.26.13 or vice versa?

0 Kudos
LorenzMeyer1
Occasional Contributor

General question to deploying azure functions with arcgis library.  How do you deploy them? I run a zip deployment, but the deployment process sometimes hangs, sometimes times out. In my opinion a pain. And tipps and tricks?

0 Kudos
GilMastrapa
New Contributor III

Don't know about Azure, but having a similar issue with google cloud functions. My conclussion is that the env gets too heavy, it seems that arcgis have A LOT of mandatory dependencies, including jupyter (which seems unnecessary for cloud env). Even the docker image provided by esri is heavy (+1gb). Ideally ESRI developers should provide better support for 'barebones' installation, minimun dependencias are not well defined in the documentation.