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:

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


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://<>:7443/arcgis", "username", "password", verify_cert = False)
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

  • Portal for ArcGIS
  • ArcGIS API for Python 1 x

Receive notifications and find solutions for new or common issues

Get summarized answers and video solutions from our new AI chatbot.

Download the Esri Support App

Related Information

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options