0

I've been trying to follow the ESRI recommended workflow to log on to Enterprise (using authentication), but it just doesn't want to work. I'm able to get the account credentials registered in Windows Credential Manager, but if I try to run the program and access them via the API for Python, I keep receiving this error:

AttributeError                            Traceback (most recent call last)

<ipython-input-1-9fd4325b765b> in <module>

     11

     12

---> 13 gis =GIS(portal_url,profile=portal_profile, verify_cert=portal_cert_check)

     14 print('Good')

 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)

    337                                    "argument when connecting to the GIS.")

    338             else:

--> 339                 raise e

    340         try:

    341             if url.lower().find("arcgis.com") > -1 and \

 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)

    321                                            expiration=self._expiration,

    322                                            referer=self._referer,

--> 323                                            custom_auth=custom_auth)

    324             if self._is_hosted_nb_home:

    325                 # For GIS("home") objects, force no referer passed in

 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\_impl\_portalpy.py in __init__(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token)

    165                                       client_id=client_id,

    166                                       custom_auth=custom_auth,

--> 167                                       token=token)

    168         #self.get_version(True)

    169         self.get_properties(True)

 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in __init__(self, baseurl, username, password, **kwargs)

    156             self._auth = "PKI"

    157

--> 158         self._create_session()

    159

    160         #  Product Info

 

~\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in _create_session(self)

    260             self._session.auth = GuessAuth(username=self._username,

    261                                            password=self._password)

--> 262         elif self._auth.lower() == "pro":

    263             self._session.auth = GuessAuth(None, None)

    264         else:

 

AttributeError: 'NoneType' object has no attribute 'lower'

1
  • 1
    You trimmed the code too tightly. The whole if statement (at least) is needed to expose the bug.
    – Vince
    Commented Oct 30, 2020 at 1:28

1 Answer 1

0

Maybe check the details in this bug

https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDEwODA2Mw==

This bug is affecting me. and there doesn't seem to be a work around. its possibly related to the Python version, thats my next step is to downgrade.

FYI im using ArcGIS API 1.4.1 and Python 3.8

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.