1

I built a Docker container to run one of our ArcGIS Python API scripts. It ran for a couple of months successfully. Recently I added some minor enhancements and rebuilt the Docker image. Thereafter, the ArcGIS API quit working properly when run in the Docker container. I decided to reduce the script down to this and it still throws an error (see below). This is the script:

from arcgis.gis import GIS
gis = GIS(settings['myurl'], settings['myusername'], settings['mypassword'],verify_cert=False) 

This is the error message:

sh-4.4# python3.9 test.py Traceback (most recent call last): File "/app/test.py", line 2, in gis = GIS('https://**','','****') File "/usr/local/lib/python3.9/site-packages/arcgis/gis/init.py", line 585, in init raise e File "/usr/local/lib/python3.9/site-packages/arcgis/gis/init.py", line 524, in init self._portal = _portalpy.Portal( File "/usr/local/lib/python3.9/site-packages/arcgis/gis/_impl/_portalpy.py", line 205, in init self.con = Connection( File "/usr/local/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py", line 344, in init self._create_session() File "/usr/local/lib/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py", line 521, in _create_session max_retries=Retry( TypeError: init() got an unexpected keyword argument 'method_whitelist'

This is the Docker file:

FROM [my org]/cloud/ubi/python:3.9
WORKDIR /app
COPY . .
RUN yum install -y krb5-libs krb5-workstation krb5-devel gcc
RUN pip3.9 install -r ./src/requirements.txt
RUN chmod 744 ./src/everyminute_run.sh
RUN chmod 744 ./src/everyhour_run.sh
RUN chmod 744 ./src/everynight_run.sh

This is the requirements.txt

psycopg2-binary
oracledb
arcgis

Note: I tried the current and the previous versions of the ArcGIS library and they both produced the same error message.

Padmanabha
1,4083 gold badges11 silver badges20 bronze badges
asked May 15, 2023 at 14:35

1 Answer 1

2

I had the same issue. I was able to solve it by downgrading the Python library 'urllib3' back to 1.26.14 in my requirements.txt file.

ie. urllib3==1.26.14

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
answered May 24, 2023 at 18:37

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.