GP Service Publishing Issue

5316
12
12-31-2014 06:32 AM
BrianLeroux
Occasional Contributor III

Hi,

When publishing a gp service to AGS server 10.22 my service is failing. It works fine in desktop though. It seems to be a problem with the sde connection file during the service creation. Taking a look at the script uploaded to the v101 folder, the esri added variable looks like g_ESRI_variable_1 = u'..\\..\\..\\..\\..\\GP_Tools\\Database Connections\\GISDB_ArcSDE(PROD Server).sde'. This path is modified from my original path to the sde connection file on my computer Shakemap_Table_Target = os.path.join("D:\\agsResources\\GP_Tools\\GISDB_ArcSDE(PROD Server).sde", "ArcSDE.dbo.EQ_SHAKEMAPS").

When debugging, AGS Server can't seem to locate that location. Is this a known bug or something I may be doing incorrectly? I am able to fix the problems by modifying the script to point that variable at a server location where i store the sde files but I am wondering if there is a better solution. I have to jump through hoops to get access to the uploaded scripts on my production server and would rather this just work when publishing.

i appreciate any and all feedback.

Tags (2)
0 Kudos
12 Replies
847396730
Occasional Contributor III

Can you publish map services successfully, or do they fail also?

0 Kudos
BrianLeroux
Occasional Contributor III

I have no issues publishing map services that reference my sde DB. The sde DB is registered properly.

0 Kudos
847396730
Occasional Contributor III

So the issue is exclusively with gp services.  What does the AGS Server log say?

0 Kudos
BrianLeroux
Occasional Contributor III

Yes just gp services. Pretty basic error messages.

"FieldMappings: Error in adding table to field mappings Failed to execute (ImportWildfirePerim). Failed to execute (ImportWildfirePerim)"

As I mentioned before, it is all about the sde location variable created when publishing the service. If i hard code a correct location the service will run without issue.

0 Kudos
DavidColey
Frequent Contributor

Brian,

I'm sure you are already doing something similar, I always use sde connection files that are located in my data-store directory and never have issues publishing any type of services.  In our distributed 3-machine 2-cluster architecture, our server directories are located on a file share server, where our domain arcgisserver account has read write access to all directories and all directories are shared.

Under the data-store folder, we use a DataConnections folder to house sde connection files and file geodatabases, and a GpServices folder to store toolboxes and python scripts.  This way I am always sure everything is in a shared location.  I also use UNC paths and although server complains about that at analzye, I never then have any issues with a resource not being read or otherwise not being available to Server.....hope this helps

David

0 Kudos
BrianLeroux
Occasional Contributor III

David,

We only have 1 live gis server and the directories are all local on that server. I am not allowed to access anything on that server but the server domain account has R/W access to eveything. So that means I have to publish using a local sde connection file. With map services this is fine as the DB is registered with the server.

I will have to talk to the server team to see if we can look at a similar apprach to yours where we would move the directories to a shared location.

One question I have for you is, when you publish a GP service with your UNC path to an sde file, does esri add variables that point to the location of these files? I am curious is they are recognizingnetwork paths and not changing those but if it sees a local path it makes modifications. Looking at the variables created it seems like the sde file should be copied with the service but that is not happening.

Thanks!

0 Kudos
DavidColey
Frequent Contributor

Does esri add variables?  I'm not sure what you mean

0 Kudos
BrianLeroux
Occasional Contributor III

They do. If i look at the python scripts after publishing I notice new variables g_ESRI_variable_1, g_ESRI_variable_2, etc... You would notice them at the top of the python script.

Here is what I wrote in my initial post describing my issue.

"Taking a look at the script uploaded to the v101 folder, the esri added variable looks like g_ESRI_variable_1 = u'..\\..\\..\\..\\..\\GP_Tools\\Database Connections\\GISDB_ArcSDE(PROD Server).sde'. This path is modified from my original path to the sde connection file on my computer Shakemap_Table_Target = os.path.join("D:\\agsResources\\GP_Tools\\GISDB_ArcSDE(PROD Server).sde", "ArcSDE.dbo.EQ_SHAKEMAPS")."

0 Kudos
DavidColey
Frequent Contributor

Now I understand.  I'll check and reply back

0 Kudos