Error when running extract_data on 1.3.0 API

1162
12
04-25-2018 04:15 PM
PhilLarkin1
Regular Contributor

This code was previously running successfully, for months. It now fails with this error: 

   {"messageCode": "AO_100026", "message": "ExtractData failed."}

import arcpy
from arcgis.gis import GIS
from arcgis.features.manage_data import extract_data

gis = GIS("http://spokanecounty.maps.arcgis.com/","<usr>","<pw>")
agolItem = gis.content.get('76d5d453ed374160ab20cd61bf97b056')‍‍‍‍‍‍‍‍‍‍‍‍‍
outputGDB = extract_data([agolItem])

I have attempted to: define the data_format as shapefile and filegeodatabase, run this on a cloned copy of the data, run this on a different machine on a different Pro licence (named user vs concurrent), run this as a different user, run this with access to 'Everyone', changed the Export Data setting of the agol item to 'Allow others to export to different formats'. Has this occurred for anyone on the 1.3.0 api? 

Test Dataset: http://spokanecounty.maps.arcgis.com/home/item.html?id=76d5d453ed374160ab20cd61bf97b056 

12 Replies
NathanRenn2
New Contributor

Have you found a solution to this? I just ran into this issue on a script that had no problems for months as well.

0 Kudos
PhilLarkin1
Regular Contributor

Hi Nathan Renn

No, I'm holding out hope that the 1.4.2 version will fix this issue. I'm not currently able to test or upgrade to this version. 

Here is a full traceback for anyone else troubleshooting:

2018-06-07 05:00:36,777 181 ERROR arcgis._impl.tools {"messageCode": "AO_100026", "message": "ExtractData failed."}
2018-06-07 05:00:36,777 181 ERROR arcgis._impl.tools Failed to execute (ExtractData).
2018-06-07 05:00:36,777 181 ERROR arcgis._impl.tools Failed.
2018-06-07 05:00:37,093 152 ERROR Marijuana_Logger Traceback (most recent call last):
  File "C:\Automation\Python\Jobs-ISD\MarijuanaOdorComplainsToSDE\Code\MarijuanaOdorComplaintUpdate.py", line 62, in <module>
    outputGDB = extract_data([agolItem])
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis-1.3.0-py3.5.egg\arcgis\features\manage_data.py", line 92, in extract_data
    context)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis-1.3.0-py3.5.egg\arcgis\_impl\tools.py", line 1279, in extract_data
    job_info = super()._analysis_job_status(task_url, job_info)
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis-1.3.0-py3.5.egg\arcgis\_impl\tools.py", line 188, in _analysis_job_status
    raise Exception("Job failed.")
Exception: Job failed.
0 Kudos
NathanRenn2
New Contributor

Ok thanks. That is the same error I am getting as well :\

0 Kudos
Zach_Robinson
New Contributor III

Hi Phil Larkin‌ & Nathan Renn‌,

I'm having the same issue. Have either of you made any progress with this error trying to download content? It's quite frustrating not being able to access my own hosted content. 

0 Kudos
PhilLarkin1
Regular Contributor

Hello

This still fails on version 1.4.1. Issues I have had with the API either stem from improperly importing modules or documentation not being updated.

I'm not sure if this function is available in versions earlier than 1.4.2. You might want to give it a shot. 
https://esri.github.io/arcgis-python-api/apidoc/html/arcgis.html?highlight=extract_data#arcgis.extra...

Zach_Robinson
New Contributor III

Phil, I found success using arcgis.extract_data. Thanks for sharing that alternative!

0 Kudos
PhilLarkin1
Regular Contributor

Great, glad it worked for you. Would you mind sharing the code you used, starting with the imports? 

0 Kudos
NathanRenn2
New Contributor

I too would like to see the code. I just tried this and it still doesn't work for me.

0 Kudos
Zach_Robinson
New Contributor III

I found success extracting another user's content from within my organization using arcgis.extract_data from within ArcGIS Pro. The steps I took are:

  1. Create a new ArcGIS Pro project
  2. Add the user's content from the Portal window in ArcGIS Pro
  3. Create a new polygon that defines the extent of the data extraction
  4. I then ran the following commands in the Python window in ArcGIS Pro:
from arcgis import *
gis = GIS("pro")

#PreferentialParking_WebEditor is the name of the AGOL layer in my ArcGIS Pro session
#Extraction Area is the name of the local layer in ArcGIS Pro that defines the extent

arcpy.server.ExtractData("PreferentialParking_WebEditor", "Extraction Area", "File Geodatabase - GDB - .gdb", "ESRI GRID - GRID", "Same As Input", None, r"C:\Users\webadmin\Desktop\prefpark.zip")‍‍‍‍‍‍‍

This successfully exported the user's content to a zipped GDB. My plan now is to schedule this process so that it runs weekly.

0 Kudos