ERROR

json.decoder.JSONDecoderError:Expecting value: line 1 column 1

Last Published: August 5, 2021

Error Message

Running an ArcGIS API for Python script that requires signing in to Portal for ArcGIS may fail and return the following error:

Error:
json.decoder.JSONDecoderError:Expecting value: line 1 column 1
Error return in the Python console when running the script to log into Portal for ArcGIS

Cause

This error occurs when attempting to connect to Portal for ArcGIS using the domain name server (DNS) alias and the portal is authenticating through a web-tier authentication (IWA or SAML).

Solution or Workaround

To solve this issue, use the fully qualified domain name (FQDN) to connect to the portal.

gis = GIS("https://<machine.domain.com>:7443/arcgis", "username", "password", verify_cert = False)
Note:
For portals authenticating through web-tier authentication, using the FQDN with port 7443 is the only workaround for this issue, and users are unable to use DNS within the script.
The script sample of connecting to the portal using the FQDN

Article ID:000024610

Software:
  • Portal for ArcGIS
  • ArcGIS API for Python 1 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic