Publish python script

679
5
Jump to solution
03-26-2020 11:56 AM
jaykapalczynski
Frequent Contributor

not sure if this is the best forum for this question as it leaves the python realm a bit....

I have a python script that does some stuff

    * this runs fine in the editor

I then create a toolbox tool and point it to the python script

    * i can double click the toolbox enter the parameters and run this with no issues

I then publish this to ArcGIS Server after running it

I then go to Server and launch the service and enter the parameters....

it fails....

Anyone have any thoughts on what I should check?  Cant seem to narrow this down

0 Kudos
1 Solution

Accepted Solutions
DanPatterson_Retired
MVP Emeritus

did you go through authoring, publishing and using... python scripts beginning in this section.

ArcGIS Pro help, modify if needed

Authoring geoprocessing services with Python scripts—ArcGIS Pro | Documentation 

View solution in original post

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

did you go through authoring, publishing and using... python scripts beginning in this section.

ArcGIS Pro help, modify if needed

Authoring geoprocessing services with Python scripts—ArcGIS Pro | Documentation 

0 Kudos
jaykapalczynski
Frequent Contributor

This is where I am blowing up......cant figure it out

I am trying to use an SDE connection file that I copied to a location on my server...

This works when I run from the GP tool on the server, but fails when I run it after publishing....

arcpy.MakeFeatureLayer_management('C:/Work/CountySelection/connection.sde/Counties_1_Dissolved', 'counties_lyr')

arcpy.MakeFeatureLayer_management('C:/Work/CountySelection/connection.sde/Buffer_1', 'buffer_lyr')

results = arcpy.SelectLayerByLocation_management('counties_lyr', 'INTERSECT', 'buffer_lyr')‍‍‍‍‍‍
0 Kudos
DanPatterson_Retired
MVP Emeritus

errors would help

0 Kudos
jaykapalczynski
Frequent Contributor

descriptive errors from ESRI...hahahaah  

this is all I get when trying to run from the RestEP

but works fine from the GP Tool itself 

DavidPike
MVP Frequent Contributor

Perhaps copy the connection file to the server with a full path, have you set up setparameter etc as derived output?

On publishing you should be able to specify the level of error messaging.