laptop and a wrench

Erro

When making a connection to ArcGIS online using a built-in account with the GIS module and then trying to query a public ArcGIS Server service, the following error is returned, "Invalid Token(Error Code: 498)"

ArcGIS Pro
Número de ID do Erro BUG-000143606
EnviadoOctober 12, 2021
Última ModificaçãoJune 5, 2024
Aplica-se àArcGIS Pro
Versão encontrada2.8.3
Sistema OperacionalN/A
Versão do Sistema OperacionalN/A
StatusNon-Reproducible

Informações Adicionais

This issue is not reproducible in the current version of ArcGIS API for Python.

Solução Provisória

After the first query from ArcGIS Online, connect to ArcGIS Online as an anonymous user by adding the following line in the code: gis=GIS( ) and the error for invalid token does not appear.

It looks like this:

import arcpy, numpy

from arcgis.features import FeatureLayer

from arcgis.gis import GIS

from arcgis import features

from arcgis.features import FeatureLayerCollection

gis = GIS('https://arcgis.com','username', "password")

sweepAll = gis.content.get('2c007bd09e3f42eab1fed4e0ba20bd40')

print(sweepAll.layers)

sweepAllLyr = sweepAll.layers[0]

print(sweepAllLyr)

query_result1 = sweepAllLyr.query(where='1=1')

print(len(query_result1.features))

print("*********************") 

gis=GIS( )

roadsURL = 'https://appsoporte.esri.co/supportrest/rest/services/Hosted/Park/FeatureServer/0'

roadsFL = FeatureLayer(roadsURL)

query_result2 = roadsFL.query(where='1=1')

print(len(query_result2))

The error is not returned. There is a bug that prevents querying public services from Portal for ArcGIS when connected to ArcGIS Online.

This issue is not reproducible in ArcGIS Pro version 2.7.x (Python shell 3.7.9).

It is not necessary to connect to ArcGIS Online as an anonymous user before querying the service.

Etapas para Reproduzir

ID do Erro: BUG-000143606

Software:

  • ArcGIS Pro

Seja notificado quando o status de um erro mudar

Baixe o Aplicativo de Suporte da Esri

Descubra mais sobre este tema

Obtenha ajuda de especialistas do ArcGIS

Entre em contato com Suporte Técnico

Baixe o Aplicativo de Suporte da Esri

Ir para as opções de download