Select to view content in your preferred language

Token required, Error 499 when trying to use Spatially Enabled Dataframe & ArcGIS Online (Jupyter)

3944
9
01-18-2021 08:57 AM
by Anonymous User
Not applicable

Hi,

When trying to use the Spatially Enabled Dataframe via a Jupyter Notebook:

 

sdf = pd.DataFrame.spatial.from_layer(featLayer)
sdf

 

 

I get the following error:

Exception: Could not load the dataset: Token Required
Token Required
(Error Code: 499)

 

My authentication to ArcGIS Online is OK, I can search and use content via the same authentication, but when i try the sdf, this error appears - does anyone have any suggestions?

0 Kudos
9 Replies
DanPatterson
MVP Esteemed Contributor
by Anonymous User
Not applicable
Hi,

That’s the exact error yes, but as my situation is specifically with ArcGIS Online would this solution still apply? Also, our org is active directory managed and built in users are prohibited.

Cheers,
Mark
0 Kudos
DanPatterson
MVP Esteemed Contributor

I would post an issue on their github site

Esri/arcgis-python-api: Documentation and samples for ArcGIS API for Python (github.com)

they don't visit here often


... sort of retired...
simoxu
by MVP Regular Contributor
MVP Regular Contributor

Do you have access to that layer? 

More details (code) will be helpful to pin-point the issue.

0 Kudos
markjones6
Emerging Contributor

Yeah, so the layer is owned by myself and I am admin on the AGOL organisation in question, so there shouldn’t be any authentication issue, in actual fact if I try to create a sdf in a notebook in AGOL itself, it works perfectly using the same item and code, so it appears to be the OAuth2 authentication.

Once I’ve authenticated using my client ID and have a token, I use the following:

item = gis.content.get("itemid")
featLayer = item.layers[0]

sdf = pd.DataFrame.spatial.from_layer(featlayer)

 

0 Kudos
simoxu
by MVP Regular Contributor
MVP Regular Contributor

I did a quick test on my portal, reproduced the error you are experiencing.  It seems caused by the bug @DanPatterson mentioned above

We can only hope ESRI can get it fixed very soon. 

In the meantime, except the "Alternative Solutions" mentioned by ESRI, another workaround is to Share the item to Everyone if it is an option.

DanPatterson
MVP Esteemed Contributor

The workaround apparently, wasn't tested and since the status is New, then that is the only alternative for the moment


... sort of retired...
0 Kudos
markjones6
Emerging Contributor

Yup, I took your advice and posted as an issue on their github, hopefully they will get this fixed soon as it’s pretty frustrating and has me wondering if this is also the root cause of some other issues I’ve been experiencing between arcpy and AGOL.

0 Kudos
Shingo-Ikeda
Regular Contributor

I am also having the same issue and posted in the same issue.  I am using esri living atlas layer for state boundary and having the exact same issue. I am puzzled since the same exact code worked up until few weeks ago. I think this is a major issue that needs to be addressed for anyone who is using Python API to create and process a spatially enabled dataframe. 

Shingo Ikeda
Geospatial Data Scientist/Developer - Geographical Information Platform
Global Power Generation - Digital Satellite USA and Canada
0 Kudos