I have a ArcGIS Pro 2.9.12 python toolbox tool that adds a feature layer to a map. A simplified version is below. It works fine in ArcGIS Pro, but when I publish it to my ArcGIS 10.6 Server I can't figure out how to achieve the same effect where the user runs an AGOL WAB geoprocessing widget and the result is a new layer in the map. Here are the relevant parts of the tool
def getParameterInfo(self):
return [arcpy.Parameter(displayName="States", name="states", datatype="GPFeatureLayer", parameterType="Derived", direction="Output")]
def execute(self, parameters, messages):
db_dir = r'C:\Users\dmorri28\Documents\ArcGIS\Projects\MyProject\CC-SQL2k16-ERC-SDE.sde'
feature_class = os.path.join(db_dir, "ROW_Habitat.SDE.USA_States_Generalized_Trimmed")
layer_name = "States"
lyr = arcpy.MakeFeatureLayer_management(feature_class, layer_name)[0]
arcpy.SetParameter(0, lyr)
Here are the publishing options

I've tried various combinations and nothing works. I do see various errors in the server manager log:
- Can not open file c:\arcgisserver\directories\arcgisjobs\testing_only\states_gpserver\j8ca6a20d8a324d2dbbfad9bccb56cd79\Results.msd. The system cannot find the file specified. Probable cause: The file is inaccessible to Server. (that file does not exist at the location)
- Failed to find the map.
- Instance of the service 'TESTING_Only/States.GPServer' crashed. Please see if an error report was generated in 'C:\arcgisserver\logs\ERC-ROW01.AD.UIC.EDU\errorreports'. To send an error report to Esri, compose an e-mail to ArcGISErrorReport@esri.com and attach the error report file. (nothing there)
Do anybody know the secret to making this work?