Hi!
I've created a tool that uses `StageUtilityNetwork` tool from untools.
It works perfectly fine in ArcGis Pro but when I publish this tool as a GP server it throws error:
ERROR 000824: The tool is not licensed. Failed to execute (StageUtilityNetwork).
ArcGis Server v.11.1, Linux, has Advanced license level.
Would appreciate any help, pals!
Solved! Go to Solution.
def isLicensed(self):
"""Set whether tool is licensed to execute."""
standard = arcpy.CheckProduct("ArcEditor") in ("Available", "AlreadyInitialized")
advanced = arcpy.CheckProduct("ArcInfo") in ("Available", "AlreadyInitialized")
return standard or advanced
Because it is running under an ArcGIS Server context, this function is presumably returning `False`.
I'm not sure how Server Python is running on Linux (Wine?), but untools is only built on win-64. https://anaconda.org/Esri/untools/files
Even if the license check were changed to work on both Server/ArcGIS Pro, there's probably further work that would need to be done to ensure every tool works on linux-64.
Publish and consume services with a utility network—ArcGIS Pro | Documentation
states
License:
The active portal account must be licensed with the ArcGIS Utility Network user type extension to create, publish, and work with a utility network in an enterprise geodatabase.
If that is relevant in your case
Thanks for your reply. This is true. The user acc that uses tool must have UtilityNetwork license. I'll double check that, but in this case it is something different.
1. The user do have the license
2. The error (ERROR 000824) i believe is about arcgis environment license level - like Basic, Standard and Advanced.
Stage Utility Network was not intended to be run on ArcGIS Server (ie, as a GP service). You would need to install untools (the python package) into Server's python environment.
Can you explain your workflow for creating a utility network via a service?
Your are precisely correct. To run "Stage Utility Network" tool I need untools library installed into ArcGis Server Environment.
I've done that, double-checked - it is there, installed and available. The error is not about import.
I've created a tool that works locally in ArcGis Pro 3.1, can be published after successful run, but, for some reason, don't want work on ArcGis Server. This tool is peaty simple: It creates .sde file, download asset package and run Stage Utility Network.
def isLicensed(self):
"""Set whether tool is licensed to execute."""
standard = arcpy.CheckProduct("ArcEditor") in ("Available", "AlreadyInitialized")
advanced = arcpy.CheckProduct("ArcInfo") in ("Available", "AlreadyInitialized")
return standard or advanced
Because it is running under an ArcGIS Server context, this function is presumably returning `False`.
I'm not sure how Server Python is running on Linux (Wine?), but untools is only built on win-64. https://anaconda.org/Esri/untools/files
Even if the license check were changed to work on both Server/ArcGIS Pro, there's probably further work that would need to be done to ensure every tool works on linux-64.
Yeah! This totally make sense. Thanks for enlightening me.