Error executing tool. GP Server Script Tool Fails

801
2
05-04-2023 07:53 AM
iolea
by
New Contributor II

I have created a python script to automate the output of several maps that are created weekly.

For the past year it has worked without any problems, and now it seems that for some reason it is not working properly.
The script is uploaded to ArcGIS Server (version 10.9.1), locally and through ArcGIS Pro (3.0.3 version), the script runs and works correctly.

However, when I run the script from REST on the server, I get the following error:

Error executing tool. Script Job ID: ja80780b469e54e149b0c59cf5b8fa0f6 : Traceback (most recent call last): File "D:\arcgisserver\directories\arcgissystem\arcgisinput\WNV\WNV_MapOutput.GPServer\extracted\p20\script\WNF.py", line 14, in <module> aprx = arcpy.mp.ArcGISProject(folder + '/' + 'WNV_WeeklyMaps' + '/' + 'WNF_Maps.aprx') File "C:\Program Files\ArcGIS\Server\framework\runtime\ArcGIS\Resources\ArcPy\arcpy\_mp.py", line 346, in __init__ self._arc_object = arcgisscripting._mapping.ArcGISProject(*gp_fixargs((aprx_path,), True)) OSError: //zvgis.ecdcdmz.europa.eu/SharedData/MapProjects/WNV/WNV_WeeklyMaps/WNF_Maps.aprx Failed to execute (Script).

 

Any idea how to fix it?
I've changed the script several times, the paths and I've also resubbed it, and it still doesn't work.

Attached is a screenshot with part of the code

CaptureWNV.PNG

Thanks

 

0 Kudos
2 Replies
VincentLantaca
New Contributor III

Did you ever find out a solution? I am having the same issue as well.

 

aprx_path = os.environ["APRX_PATH"]
arcpy.AddMessage('APRX_PATH: {}'.format(aprx_path))
if os.path.exists(aprx_path):
    arcpy.AddMessage('aprx_path exists')
else:
    arcpy.AddMessage('aprx_path DNE')
aprx = arcpy.mp.ArcGISProject(aprx_path)

 

 
In my case I have verified that the path exists when run from a service, and it is still giving me an OSError, despite working fine when I run manually in Pro (3.1).

0 Kudos
iolea
by
New Contributor II

No, sorry, I haven't found a solution yet, but after a lot of testing, it seems that there is an incompatibility issue between the version of ArcGIS Pro I have installed (3.0) and the server version (version 10.9.1).

Some Esri colleagues  have told me that the best solution is to upgrade the server I have from enterprise to version 11.
On the other hand, I have tested on a virtual machine with ArcGIS Pro version 2.9 and my current server with version 10.9.1 and it works. So, it seems to be the problem. However, I don't want to run an older version of ArcGIS Pro as I have done projects with version 3.
I hope this helps.
Regards