I really need help getting my server logging to work

908
9
01-09-2014 12:58 PM
MichaelEber
Occasional Contributor
I am running 10.1 Arc Server and we have several services published to the service.  Tools in arcGIS Explorer Desktop call these services and display the results.  And....everyone that published the former services no longer work here and I wasn't working here when they did.  So I'm shooting in the dark hoping to hit something.

I have a service which runs in Arcmap without a problem.  Once it finishes I publish the service to the server and push the new dll to the published library location.

In the client I get only 3 messages from the server (even though I'm putting out a TON of messages)
  Running service.
  Executing...
  Failed.

Thank you very much for such explicite data ESRI!!

On the server I get a log message that looks like this:


VERBOSE Jan 9, 2014 3:02:56 PM GPServerSync.Deactivate CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 378 characters. CalculateDistances.GPServer
VERBOSE Jan 9, 2014 3:02:56 PM Save job message type SOAP message size 378 CalculateDistances.GPServer       
VERBOSE Jan 9, 2014 3:02:56 PM Save job message type SOAP message size 374 CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 433 characters. CalculateDistances.GPServer       
VERBOSE Jan 9, 2014 3:02:56 PM GPServerSync.Activate CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 406 characters. CalculateDistances.GPServer
FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 384 characters. CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:56 PM String request successfully processed. Response size is 385 characters. CalculateDistances.GPServer
FINE Jan 9, 2014 3:02:56 PM String request received. Request size is 380 characters. CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:55 PM String request successfully processed. Response size is 385 characters. CalculateDistances.GPServer
FINE Jan 9, 2014 3:02:55 PM String request received. Request size is 380 characters. CalculateDistances.GPServer       
FINE Jan 9, 2014 3:02:55 PM String request successfully processed. Response size is 396 characters. CalculateDistances.GPServer VERBOSE Jan 9, 2014 3:02:55 PM Job jbbc989cb7b08467b9e57d7c4a21db9e2 is successfully submitted. CalculateDistances.GPServer

So it looks like the job was successfully submitted, the parameters were received without a problem, the response appears to have been sent yet I see nothing that shows any failure!

I added a reference so that I could access ServerLogger and add my own logging to the log.  But my messages do not show up here.  And there is no process that I can find that I can attach to that lets me enter debug mode to debug my server code.  Thank you very much again ESRI. 

So how do I debug my service in this pile of failure that ESRI pretends is a server service???  How can I get my logging to work?  How can I attach to something so I can debug my code and find out what is failing???  How can anyone publish a working service with so many roadblocks to debugging placed in front of us by ESRI???!!!!

Thanks
0 Kudos
9 Replies
RichardWatson
Frequent Contributor
I don't know squat about GP services.

That said, System.Diagnostics.Debugger.Launch and System.Diagnostics.Debugger.Break are great tools for launching the debugger from your code when you don't control the code which launches the host executable image.
0 Kudos
MichaelEber
Occasional Contributor
I've used that for debugging when the code is executed in ArcMap.  I tried doing that with the service but the launch request for a debugger listener seemed to be blocked.  I never got the listener-attach dialog.
0 Kudos
RichardWatson
Frequent Contributor
0 Kudos
MichaelEber
Occasional Contributor
If you are using Windows 8 (or later) then try this:

http://forums.arcgis.com/threads/69842-Debugging-your-SOE-on-Windows-8?highlight=service


Wow -- thank you so much for that link.  I went onto our 2008 server and found that the 0x00000020 flag was turned on.  so I turned it off and now I'm ready to debug!!!  Thank you.
0 Kudos
MichaelEber
Occasional Contributor
Well blighters!

No debugger launched.  So I would assume then that my service code is never getting hit.  I even put a non-conditional launch of the debugger as the first statement in my service call and still no debugger.  So how do I find out why my client and server aren't talking now?  I get nothing on the client except that the service failed.  I get no exception.  I get no launch of the debugger.  And my parameters are all the same between client and server.  In fact, Fiddler sees my call as a totally successful call and it even looks like the service was activated and called!!!

I am totally stumped now.
0 Kudos
RichardWatson
Frequent Contributor
If you know the name of the host process that is being created then you can use the "Global Flags" utility to do so.

Go to the "Image File" tab and specify the name of executable image and then input the Debugger information.

Here are a couple of links:

http://stackoverflow.com/questions/2053724/how-to-debug-with-external-program-launched-from-bat-not-...

http://msdn.microsoft.com/en-us/library/windows/hardware/ff549557(v=vs.85).aspx

If you can get the debugger working then you should be able to look at the loaded modules.  If yours is not loaded then that tells you that that is your problem, i.e. some type of configuration/registration issue.
0 Kudos
ErinBrimhall
Occasional Contributor II
With regard to messaging/logging, have you tried adjusting the "Message Level" property on your Geoprocessing service?  See screenshot below.  This property allows you to control the minimum severity level of messages sent to clients when they invoke your Geoprocessing service.

[ATTACH=CONFIG]30470[/ATTACH]


Before getting too spun-up on logging or debugging, you may want to first check that your Geoprocessing tool(s) are valid and runnable on the server itself.  When you publish a Geoprocessing tool result as an ArcGIS Server service, a copy of the tool and its support assemblies is uploaded to the "arcgisinput" folder on the server, e.g.:


[INDENT]C:\arcgisserver\directories\argissystem\arcgisinput\<folder name>\<service name>.GPServer\extracted\v101[/INDENT]


I recommend using ArcCatalog to navigate to the Geoprocessing service's "arcgisinput" directory on the server and checking if your tool(s) can be ran directly.

Finally, you may need to register your Geoprocessing tool on the server by using EsriRegAsm.exe, e.g.:

"C:\Program Files (x86)\Common Files\ArcGIS\bin\EsriRegAsm.exe" <Geoprocessing tool DLL> /p:Desktop /s



I hope some of these ideas help you!
0 Kudos
MichaelEber
Occasional Contributor
Richard,

When I look at this log it feels to me that it actually ran my service. Would you agree? Here they are in order:

Job {guid} is successfully submitted <--my job is submitted by the client
String request successfully processed.  <--my parameters are processed and received
String request received.
String request successfully processed.
...
GPServerSync.Activate CalculateDistance.GPServer <-- my service is now activated and the parameters are passed
string request received.
Save job message type SOAP ... <-- I sent back a fracking response!!!
Save job message type SOAP ...
another set of string request processed/string request received
GPServerSync.Deactivate <-- process completed and service is deactivated

I added my notes on what I think their server is doing.
0 Kudos
MichaelEber
Occasional Contributor
With regard to messaging/logging, have you tried adjusting the "Message Level" property on your Geoprocessing service?  See screenshot below.  This property allows you to control the minimum severity level of messages sent to clients when they invoke your Geoprocessing service.


It is part of our standard practice to always set the message level to Info when publishing services.



Finally, you may need to register your Geoprocessing tool on the server by using EsriRegAsm.exe, e.g.:

"C:\Program Files (x86)\Common Files\ArcGIS\bin\EsriRegAsm.exe" <Geoprocessing tool DLL> /p:Desktop /s



I'm pretty sure I already commented in this thread that we publish all of our services in a single dynamic load library.  So all services are registered with that single DLL.


Before getting too spun-up on logging or debugging, you may want to first check that your Geoprocessing tool(s) are valid and runnable on the server itself.  When you publish a Geoprocessing tool result as an ArcGIS Server service, a copy of the tool and its support assemblies is uploaded to the "arcgisinput" folder on the server, e.g.:

[INDENT]C:\arcgisserver\directories\argissystem\arcgisinput\<folder name>\<service name>.GPServer\extracted\v101[/INDENT]

I recommend using ArcCatalog to navigate to the Geoprocessing service's "arcgisinput" directory on the server and checking if your tool(s) can be ran directly.


Well I've worked with remoting 1.0, WCF ever since it came out, REST services and a few others.  All of them have a way of easily ensuring that your service is functional so that you can focus on the plumbing between the client and server.  This abortion that ESRI has created flies in the face of professionally developed services.  But with that said I find this one suggestion the most useful for what I need to do.  I'll give this a try!!  Most definitely.  Though the entire publication process they dumped on us in 10.1 is supposed to prove that the service runs before it is ever published.  Thanks for the input.

Michael
0 Kudos