ESRI Server Startup Timeout

4006
5
Jump to solution
05-31-2016 09:31 AM
DaveTenney
Regular Contributor

well this is a new one....

Error: JSON object returns an error. Error returned when starting service ServiceName.MapServer.

we have been running update scripts via python not for over a year without any issue, now all of a sudden were seeing this "timeout" error when trying to restart a service after it was successfully stopped and updated.

ArcGIS for Desktop: 10.2.2

ArcGIS for Server: 10.2.2

    anyone else run into such an error?

thanks

Dave

0 Kudos
1 Solution

Accepted Solutions
RebeccaStrauch__GISP
MVP Esteemed Contributor

Gremlins after the long weekend?

Having a second run work makes me think that it is a timing issue, that is something was stopping or starting and needed time to complete before it could continue. Tracking that down may be as simple as figuring out what you did just prior to running, but if is was system/OS related, hard to tell.  Did you run this right after a system or AGS restart, or after a refresh of the service?  Maybe there needs to be a "pause" before it is run.

I'm not a JSON expert by any means, so just throwing some thoughts out there, fwiw.

View solution in original post

0 Kudos
5 Replies
RebeccaStrauch__GISP
MVP Esteemed Contributor

I haven't dissected this sample script, but it looks like that error message is one that can be returned from this script...but design.  So might be work taking a look at this (I plan to look at it in more depth)

Example: Stop or start all services in a folder—Documentation (10.3 and 10.3.1) | ArcGIS for Server

I'm assuming it would be the same for 10.2.2

Snippet from script...

#   stuff before this....
# A function that checks that the input JSON object 
# is not an error object.
def assertJsonSuccess(data):
   obj = json.loads(data)
   if 'status' in obj and obj['status'] == "error":
   print "Error: JSON object returns an error. " + str(obj)
   return False
   else:
   return True

# stuff after this...
0 Kudos
DaveTenney
Regular Contributor

I guess im a little unclear what would cause the input json object to be an error?

  this error was thrown on the first attempt and failed to restart one of our map services and a few minutes later the script was rerun and ran successfully and the service was restarted.

dave

0 Kudos
RebeccaStrauch__GISP
MVP Esteemed Contributor

Gremlins after the long weekend?

Having a second run work makes me think that it is a timing issue, that is something was stopping or starting and needed time to complete before it could continue. Tracking that down may be as simple as figuring out what you did just prior to running, but if is was system/OS related, hard to tell.  Did you run this right after a system or AGS restart, or after a refresh of the service?  Maybe there needs to be a "pause" before it is run.

I'm not a JSON expert by any means, so just throwing some thoughts out there, fwiw.

0 Kudos
BillDaigle
Occasional Contributor III

It might be a resource issue.  If you have more services, or higher usage than you had before, starting up the service may just take longer.  It may be worth

  • looking at server memory usage/ CPU and make sure you still have room to grow.
  • increase the allowable server startup time
  • take a look at the server logs to see if there is any more detail there

In general, I wouldn't be too concerned if this was an isolated (or even rare) event.

0 Kudos
DaveTenney
Regular Contributor

so may have just been gremilns or resource issue, not sure but we have not experienced the issue since and our scripts have been run multiple times for testing.

we did adjust our scripts for just letting us know if this happens, to actually throwing an exception.

thanks again for all the input and thoughts, it has been greatly appreciated!

Dave

0 Kudos