操作方法

错误:json.decoder.JSONDecoderError:预期值:行 1 列 1

Last Published: August 24, 2024

描述

运行需要登录 Portal for ArcGIS 的 ArcGIS API for Python 脚本可能会失败并返回以下错误:

Error:
json.decoder.JSONDecoderError:Expecting value: line 1 column 1
运行脚本以登录 Portal for ArcGIS 时 Python 控制台返回错误

原因

当尝试使用域名服务器 (DNS) 别名连接到 Portal for ArcGIS 并且门户正在通过 Web 层(IWA 或 SAML)进行身份验证时,会发生此错误。

解决方案或解决方法

要解决此问题,请使用完全限定域名 (FQDN) 连接到门户。

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.
使用 FQDN 连接到门户的脚本示例

文章 ID: 000024610

接收通知并查找新问题或常见问题的解决方案

从我们全新的 AI 聊天机器人中获得简明答案和视频解决方案。

下载 Esri 支持应用程序

相关信息

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项