Problems with geoprocessing service created in python

1273
7
12-18-2017 12:32 AM
TorbjørnDalløkken2
Occasional Contributor

Hi.

I'm experiencing some problems with a geoprocessing service which I've created, that I'm not able to figure out so I hope some of you have any suggestions. 

A bit of background:

I have a webapplication (created with webappbuilder) where the user can run a geoprocessing service (gp 1) to get some resulting points. The user is then going to run a second geoprocessing service (gp 2) which sends some information from the result to another external webservice. The users are not going to run the same geoprocessing service (gp 2) twice. 

The problem: 

I've created a script in python which reads the points from the last ran job (gp 1) and uses the library Zeep to connect to the external webservice. Inside the script, I've also added some functionality to find out whether the script has been run before or not.  I've published this as a geoprocessing service (gp 2) with some parameters. So far, so good. When I go to the webapplication and try to run this, it works well. If I try to run the script a second time, in the same session, I get the error "could not service request". I would like the output to be "The script has already been run", as defined in my script.  In ArcGIS Server Manager, the only information in the log is that the service has crashed. If I reload the webapplication, I can run the script once more and this time I get the right output.

Does anyone know or have any idea of why my geoprocessing service crashes, every second run?

0 Kudos
7 Replies
XanderBakker
Esri Esteemed Contributor

I do remember some behavior in an old version of ArcGIS Server (10.0 or 10.1?) where each second run yielded the correct response, but that was corrected in a later version What version are you using?

0 Kudos
TorbjørnDalløkken2
Occasional Contributor

The geoprocessing service is running on ArcGIS Server 10.3.

0 Kudos
XanderBakker
Esri Esteemed Contributor

In 10.3 the problem was already solved, so that shouldn't be the problem.  Did you contact your local Esri distributor? I think that in order to solve this, one should have a look at server configurations, logs, etc in order to understand what is happening. This is normally something that Esri support can help you with. Just wondering, does your script implement messages or does it write steps to a log file? Do you know at which line of the script the GP service fails?

0 Kudos
TorbjørnDalløkken2
Occasional Contributor

I've implemented messages in the script. At the second attempt of running the script, there are not written any messages to output. It seems like the GP service fails right away.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Is there any error message reported in the log files of ArcGIS Server or at the service level?

0 Kudos
TorbjørnDalløkken2
Occasional Contributor

Hello again. When setting the service log-level to info, I get this messages in the log. 

<Msg time="2017-12-22T09:14:30,472" type="SEVERE" code="8252" source="FH/Vand_Smsvarsling.GPServer" process="6416" thread="527" methodName="" machine="DWARE2541.DMZ2.LOC" user="" elapsed="">Instance of the service 'FH/Vand_Smsvarsling.GPServer' crashed. Please see if an error report was generated in 'C:\arcgisserver\logs\DWARE2541.DMZ2.LOC\errorreports'. To send an error report to Esri, compose an e-mail to ArcGISErrorReport@esri.com and attach the error report file.</Msg>
<Msg time="2017-12-22T09:14:38,138" type="SEVERE" code="8254" source="Server" process="6416" thread="1" methodName="" machine="DWARE2541.DMZ2.LOC" user="" elapsed="">The containing process for 'FH/Vand_Smsvarsling' job 'jc354140e2f4946b1acca04e0a28cbfa6' has crashed.</Msg>

When I first run the script, it works fine; the external service is called correctly and the script writes a new file "run.txt" into a folder on the jobs-directory. The second time I try to run the script, it fails with this error. If I try to run the script for a third time, again it works correctly and says that the script has been run before.

0 Kudos
XanderBakker
Esri Esteemed Contributor

Hi Torbjørn Dalløkken , 

As a side note; since the messages are of type SEVERE, they will always appear in your log indifferent of the setting of the message level. 

Instance of the service 'FH/Vand_Smsvarsling.GPServer' crashed.
Please see if an error report was generated in 'C:\arcgisserver\logs\DWARE2541.DMZ2.LOC\errorreports'.
To send an error report to Esri, compose an e-mail to ArcGISErrorReport@esri.com and attach the error report file.

Do you have an error report in the folder C:\arcgisserver\logs\DWARE2541.DMZ2.LOC\errorreports, and have you sent it to the email address provided? Did you contact Esri Support?

0 Kudos