AnsweredAssumed Answered

Publish SD file script fails after upgrade to Pro 2.2

Question asked by LeonGIS on Aug 6, 2018
Latest reply on Dec 14, 2018 by arcpygis

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'

Outcomes