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

657
9
01-18-2021 08:57 AM
mrkjns
by
New Contributor II

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 Notable Contributor
mrkjns
by
New Contributor II
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 Notable 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
New 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 Notable 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
New 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
ShingoIkeda
New Contributor II

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. 

0 Kudos