geoprocessing tool fails at 10.8.1, object has no attribute 'scratchFolder'

4150
13
Jump to solution
04-19-2021 07:47 AM
MattiasEkström
Occasional Contributor III

I have a geoprocessing tool that at the end exports points to a DWG-file, it's based on my own python script. It worked with ArcGIS Server 10.6.1, but when trying it with ArcGIS Enterprise 10.8.1 it doesn't work. I can run the tool in ArcMap and publish it succesfully to my server, but when running my geoprocessing service it fails and give me the error:

Error executing tool. Hojddata_till_DWG Job ID: jfcd1dee1b2364e73a10d9d90f4e5ef9b : Traceback (most recent call last): File "E:\arcgisserver\directories\arcgissystem\arcgisinput\Verktyg\Hojddata2dwg2.GPServer\extracted\v101\my_toolboxes\Export_Hojddata_to_DWG.py", line 24, in <module> arcpy.env.workspace = arcpy.arcpy.env.packageWorkspace.scratchFolder AttributeError: 'unicode' object has no attribute 'scratchFolder' Failed to execute (Hojddata2dwg). Failed to execute (Hojddata_till_DWG).

So I guess it has something with the scratchfolder to do, any ideas how to solve this?

The part of my python script that makes the dwg-export looks like this:

filename = "Hojdpunkter.dwg"
arcpy.ExportCAD_conversion(GridpointsZ, "DWG_R2010", filename)
outputFile = os.path.join(arcpy.env.scratchFolder, filename)  
arcpy.SetParameterAsText(2, outputFile)

 Has anything changed  between 10.6.1. and 10.8.1 of ArcGIS Server when it comes to scratchFolders or geoprocessing outputs?

Or is it me that has forgot how to properly publish a geoprocessing tool? I have set the parameters and the third one to be 'output' and 'data file'.

0 Kudos
13 Replies
DanPatterson
MVP Esteemed Contributor

C:...Your-install-folder\bin\MappingCore.dll .... didn't check for the other but it has "Arc..." in it


... sort of retired...
0 Kudos
Arne_Gelfert
Occasional Contributor III

Ahh... I see what you mean. What I intended to say was that I see those lines in the Windows application log via Event Viewer on server.

0 Kudos
MattiasEkström
Occasional Contributor III

@Arne_Gelfert Hard to tell if we have the same problem or not. I our case we didn't uppgrade from 10.6 to 10.8.1 since we have a new server with a new installation of ArcGIS Enterprise. I'm not entirely sure I'm publishing my script exact the same way I did when it worked at 10.6, but I've tried so many ways that one of them should have been the same, my inital problem was a line in my python-script that I could remove. Now my problem is that no file is exported from the script, or in some cases it does but the GP-service doesn't return an url to it.

Now I'm trying with a new model created in Pro, but have the same issues.

I have a ticket with the support at Esri Sweden, if we find something that can be helpful for you I'll let you know.

0 Kudos
Arne_Gelfert
Occasional Contributor III

Appreciate it, Mattias. Yes, it sounds like our situations are somewhat different.

By now, I have a ticket open as well. I have picked my setup apart, and everything is working except the line:

layout.exportToPDF( ... )

Layout is fine, so is the path I'm exporting to. But things still bomb. I've ruled all kinds of variations on the publishing and scratchFolder/scratchWorkspace theme. I've seen so many fixes in the Pro/Server release note related to "PDF,export, layout", I'm starting to think there is another one lurking in there ! Stay tuned...

0 Kudos