Select to view content in your preferred language

arcpy.na.MakeVehicleRoutingProblemAnalysisLayer 160706: Cannot acquire a lock

746
3
09-08-2022 03:35 AM
SOTIRIOSTRIANTOS
Regular Contributor

Hi there we've just migrated from ArcGIS desktop to ArcGIS Pro and there is an issue when trying to use concurrently arcpy.na.MakeVehicleRoutingProblemAnalysisLayer. When using arcpy we get the following error  ERROR 160706: Cannot acquire a lock.Failed to execute (MakeVehicleRoutingProblemAnalysisLayer).

With ArcGIS desktop everything worked fine. 

We tried changing env.workspace = "in_memory" to env.workspace = "memory" but it doesnt work. It appears that arcpy.na.MakeVehicleRoutingProblemAnalysisLayer is locked from the first call.

Our overall impression is that network analyst extension is not well supported in ArcGIS Pro.

Any ideas?

0 Kudos
3 Replies
DanPatterson
MVP Esteemed Contributor

You should go to

160706: Cannot acquire a lock.—ArcGIS Pro | Documentation

and provide the necessary information given that the message, according to esri....

 ... it occurs so rarely that the typical causes have not been identified so no solution is available at this time


... sort of retired...
0 Kudos
SOTIRIOSTRIANTOS
Regular Contributor

Thank you Dan, i ve just provided some info to the mentioned link. As it has to do with the error that we are facing, i believe that it is an issue of parallelism support. Apparently network analyst extension is not supported?!

https://www.esri.com/arcgis-blog/products/analytics/analytics/parallel-geoprocessing-in-arcgis-pro/

0 Kudos
JaySandhu
Esri Regular Contributor

Network Analyst is quite well supported in ArcGIS Pro!

When using the arcpy.na make analysis layer tool, the layer is created referencing the analysis workspace in a file geodatabase.  in_memory or memory env is not supported. If you are automating NA workflows in python then the recommended way is to use the arcpy.nax module (not layers). These python analysis classes will use in_memory feature classes (not file geodatases) and are high performance.

See the code samples here: VehicleRoutingProblem—ArcGIS Pro | Documentation

Jay Sandhu