Publish SD file script fails after upgrade to Pro 2.2

667
2
08-06-2018 10:56 AM
LeonS
by
Occasional Contributor II

I've noticed that after upgrading to ArcGIS Pro 2.2 that one of my scripts stopped working properly...  I rolled back to Pro 2.1 and it worked again.  Upgraded to 2.2 and it fails again.  Anyone else seen this?

Thanks,

Leon

The script... 

gis = GIS(agol_url, agol_user, agol_pass)

mySDfile = gis.content.get(itemid)

mySDfile.publish(overwrite="true")

The result....

KeyError                                  Traceback (most recent call last)
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in 
_check_publish_status(self, ret, folder)   
6580         try:
-> 6581             serviceitem_id = ret[0]['serviceItemId']   
6582         except KeyError as ke:KeyError: 'serviceItemId'  
During handling of the above exception, another exception occurred: 
KeyError                                  Traceback (most recent call last)
<ipython-input-3-eef2935b5006> in <module>()
----> 1 mySDfile.publish(overwrite="true")
C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in 
publish(self, publish_parameters, address_fields, output_type, overwrite, file_type, build_initial_cache)   
6374             return Item(self._gis, ret[0]['serviceItemId'])   
6375         else:-> 
6376             serviceitem_id = self._check_publish_status(ret, folder)   
6377         return Item(self._gis, serviceitem_id)   
6378  C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py in 
_check_publish_status(self, ret, folder)   
6581             serviceitem_id = ret[0]['serviceItemId']   
6582         except KeyError as ke:
-> 6583             raise RuntimeError(ret[0]['error']['message'])   
6584    
6585         if 'jobId' in ret[0]:
KeyError: 'error'
Tags (2)
0 Kudos
2 Replies
LeonS
by
Occasional Contributor II

Just in case anyone does run into this, here is the result of my support case....

#BUG-000116104 Script used to publish an SD file from ArcGIS Pro to ArcGIS Online using the ArcGIS API for Python doesn't work successfully at ArcGIS Pro 2.2

I'm rolling back to version 2.1 for now.

Leon

Don_Barker
New Contributor III

Thanks for documenting this.  I just ran into it while running the DevLab for Python - Import Data.

0 Kudos