I am running a custom geoprocessing tool on AGOL in a web application and I am getting the error:
Error 000210: Cannot Create Output
I have this tool set up in ArcGIS Pro in model builder where it accepts user input and runs three python scripts along with some built in tools. This error only occurs when running on AGOL. I believe the cause of this error is file locking in my environment workspace (geodatabase). This locking behavior does not happen when running on ArcGIS Pro, but when I publish to enterprise then use on AGOL in web application, lock files are created in the geodatabase. If I stop the service the locks are deleted and are created again when I run the tool on AGOL.
Are there any known file locking issues associated with publishing a tool to a GIS server from ArcGIS Pro?
Here is a snippet of code from the script before the failure happens:
savePoint = os.path.join(outgdb, "SelectedPoint") # Create a new feature set with same schema as Facilities parameter in # Generate Service Areas tool. facilities = arcpy.GetParameter(0) # Set limit on number of facilities entered - 1 maxFacilities = 1 fac_count = arcpy.GetCount_management(facilities) fac_str = str(fac_count) fac_int = int(fac_str) ''' * Title: GenerateServiceAreas_Workflow.py * Author: Esri * Date: 2019 * Code / Type version: 10.7 * Code adapted from: ArcToolbox Script / ArcMap Search ''' if fac_int > maxFacilities: arcpy.Delete_management(facilities) arcpy.AddIDMessage("ERROR", 30096, "Facilities", maxFacilities) sys.exit(0) elif facilities == '#' or not facilities: arcpy.Delete_management(facilities) arcpy.AddMessage("ERROR. Select a point on the map.") sys.exit(0) else: pass '''(Version 10.7) [Source code]. "ArcMap Search: Generate Service Areas (Network Analyst)''' # fails at the following line of code # ExecuteError: ERROR 000210: Cannot create output: pt_out = arcpy.CopyFeatures_management(facilities, savePoint) pt_out = arcpy.CopyFeatures_management(facilities, savePoint)
Facilities (arcpy.getParameter(0)) is a Feature set, point layer that is created on the map by the user.