10.4.1 Token Response

584
8
02-20-2017 11:10 AM
DaveTenney
Regular Contributor

All,

   we are running into a new issue...

we are currently working with esri support but also wanted to reach out to everyone here as well and see if anyone has experienced this...

we have python scripts that to some minimal work, nothing advanced but one less thing we have to worry about:

   Python Update Script Process

      1) stop service

      2) copy over new data

      3) start service

               this is extremely simplified but its pretty basic.

we are noticing now that when our script attempts to start the service back up and waits for token response from the service that it stalls out and we never get a response. so we successfully stop the service, do our work, try to restart the service and never get a response back.

i look at the task manager of the machine and it shows the ArcSOCs are running for the service in question, but the ESRI manager site shows the service as "starting" and never fully recovers.

thoughts?

dave

0 Kudos
8 Replies
DaveTenney
Regular Contributor

update...

  so token response does come back, but for some reason there is no response back that the service actually started if it did indeed ever start back up completely.

dave

0 Kudos
RebeccaStrauch__GISP
MVP Esteemed Contributor

Could be a timing thing.  I have a script that does basically the same thing (but inventories running services that are using my FGDB so only those are stopped/started) and I've had to put in a bunch of "sleep" times in to let the file system, etc catch up.  I have to play with the time needed, but in most cases 5-10 secs has been plenty...but for some, up to 30 secs.

import time     
def mySleep(secs):
     arcpy.AddMessage("     zzz...sleeping {0} seconds to allow network file status to catch up....".format(secs))
     time.sleep(secs)     
     
# stop your service
mySleep(5)
# start your service
0 Kudos
JonathanQuinn
Esri Frequent Contributor

Is this on Windows or Linux?  Do you see any errors within the logs about service startup timing out?  Is this a single or multi-machine site?  If it's a multi-machine site, do you see the SOC process start up on each machine?  Enable the Command Line field in Task Manager on Windows and take a look at top on Linux.

0 Kudos
MichaelVolz
Esteemed Contributor

Dave:

Can you perform a truncate and append of your data instead copying over the data which requires stopping the service?  I update many different sets of data for AGS using the truncate and append method, which has eliminated the need to stop services and thereby reduces the number of issues that I am faced with.

Has this script run successfully in your environment in the past against an older AGS version (e.g. 10.3.1) and you are now trying to run this script against an upgraded environment (10.4.1), but it's failing?

0 Kudos
DaveTenney
Regular Contributor

Michael,

    if you could please explain this process a little more, it would be greatly appreciated.

thanks

dave

0 Kudos
MichaelVolz
Esteemed Contributor

Dave:

Truncate and append is pretty simple and it's a fast process.  You are deleting all records, but the database schema is left intact and you are then appending in the new records.

env.workspace = "Destination geodatabase"

fcs = arcpy.ListFeatureClasses()

for fc in fcs:

   arcpy.DeleteFeatures_management(fc)

   arcpy.Append_management("Data source feature class, fc, "TEST", "", "")

This is the working part of the script so you can see not much code is involved.

DaveTenney
Regular Contributor

all,

   Windows VM (2012 R2)

   Only errors in logs is:

    "Unable to process request. Error handling service request :Could not find a service with the name '####/MapServer/Support' in the configured clusters. Service may be stopped or ArcGIS Server may not be running." (I watch the service in server manager just sit there in "starting" status and never come back to "started")

   Single Machine Site

   during the script process we can watch the the SOCs come and go. even after the data is copied over and the service is started back up with the see the SOCs come back in the task manager as up and running but the server manager is stuck at "starting"

hope this helps

dave

0 Kudos
JonathanQuinn
Esri Frequent Contributor

Michael Volz‌ has a good suggestion; the schema doesn't sound like it's changing so you can just update the data within the feature class without needing to stop and start the service.

In regards to the problem, what do the Configured and Real-time state show within the Admin API when clicking on the Status of the service?  That should show you which one isn't being updated.  Once both are "Started" or both are "Stopped", Manager will reflect that status.

0 Kudos