laptop and a wrench

Bug

arcpy.LayerToKML fails with Error 999999 after being published as a geoprocessing service when the input is in JSON format.

ArcGIS GIS Server
Bug ID Number BUG-000168472
SubmittedJune 20, 2024
Last ModifiedNovember 11, 2024
Applies toArcGIS GIS Server
Version found11.3
Operating SystemWindows Server
Operating System Version2022
StatusAs Designed

Additional Information

This is expected behavior. The arcpy.LayerToKML function requires a layer as input (feature layer, raster layer, mosaic layer, group layer, or layer file) and not JSON. The workaround makes the JSON file a feature set, which meets the tool's requirements.

Workaround

For script tools, replace the following line in the Python script:

input_feature_set = arcpy.GetParameter(0)

with the following:

try:

  input_feature_set = arcpy.FeatureSet(arcpy.GetParameter(0).JSON)

except:

  input_feature_set = arcpy.GetParameter(0)

Steps to Reproduce

Bug ID: BUG-000168472

Software:

  • ArcGIS GIS Server

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options