Problem updating a service created from an .msd

3006
6
12-19-2012 11:50 AM
douglascurl
New Contributor III
In order to migrate from 10.0 to 10.1, I modified a script from this post in the 10.1 Help:
http://resources.arcgis.com/en/help/main/10.1/index.html#/Example_Publish_a_service_with_detailed_pa...

which takes a JSON input of the service parameters and the .mxd, and creates an .msd from which the service is published. This worked great, however during this publishing an .sd was not generated.

The problem I'm having comes when I need to update the service via a "File" --> Share as Service --> "overwrite an existing service" in ArcMap. The tool basically crashes - I get through the first 2 windows on the dialogue (selecting the service to overwrite) and then the window goes away and nothing happens. So my question is why is this happening - can a service created from an .msd not be updated in this way? How does one update a service like this, or how to easily script to get an .sd from either the .msd or from JSON?

Thanks,
-Doug Curl
Tags (2)
0 Kudos
6 Replies
nicogis
MVP Frequent Contributor
seeing the script you have a createService. For a update you need a edit service ( http://resources.arcgis.com/en/help/server-admin-api/editService.html )
0 Kudos
RichardWatson
Frequent Contributor
I have a similar problem which relates to this discussion. 

In 9.3.1, I had a mxd file associated with a service.  After the user updated the mxd file they would run a script I provided which recycled the map service as well as any web applications associated with it.

In 10.1, the publishing workflow is different.  What is the correct workflow for updating the service using a revised map document?
0 Kudos
douglascurl
New Contributor III
Thanks Domenico for the reply - I will try that. But basically, if you create a service using the ArcGIS Admin REST API, all updates have to be done via the API vs other methods (such as updating a service in ArcMap through the share dialogue)? IMO, either this is a bug (because the update process just failed without any error message), or ESRI needs to lay this out more clearly in the documentation.

Richard, I am still trying to figure out all the correct workflows...10.1 is completely different from past versions. I used the 10.1 Admin REST API method with JSON as described above because it was the easiest way to spin up my 10.0 services in 10.1 - but if I can't update them easily, then that method is not what I should have used. Now I'm thinking I may need to convert my JSON to .sddraft documents and then start the services from there.
0 Kudos
ErinBrimhall
Occasional Contributor II
Thanks Domenico for the reply - I will try that. But basically, if you create a service using the ArcGIS Admin REST API, all updates have to be done via the API vs other methods (such as updating a service in ArcMap through the share dialogue)? IMO, either this is a bug (because the update process just failed without any error message), or ESRI needs to lay this out more clearly in the documentation.

Richard, I am still trying to figure out all the correct workflows...10.1 is completely different from past versions. I used the 10.1 Admin REST API method with JSON as described above because it was the easiest way to spin up my 10.0 services in 10.1 - but if I can't update them easily, then that method is not what I should have used. Now I'm thinking I may need to convert my JSON to .sddraft documents and then start the services from there.


While I can't explain the strange behavior using the Desktop tools (the Share/Publish dialog just disappears?), I think there is a path from start to finish using ArcPy and the AGS Admin REST endpoint.

To create a Map Service from an MXD, you would use:


[INDENT]CreateMapSDDraft --> .sddraft -->  AnalyzeForSD --> .sddraft --> StageService --> .sd[/INDENT]


Once you have your .sd file, you should be able to script the creation of the service as you already are (based on this example)

Then, to edit your Map Service properties and apply a new/modified Map Document, you would use the same steps from above to create the .sd file from the .mxd and then (as Domenico recommended) script your Python to invoke the Edit Service REST function.

One seemingly important note from the "Edit Service" documentation: "Any other properties that are left out of the JSON are not persisted by the server." It sounds like "Edit Service" pretty much recreates the service using whatever properties you specify, so be sure to set any values you used during initial service creation, even if they are not changing.

Worst case scenario if "Edit Service" is not doing the trick, you could always Delete and recreate it entirely with your updated properties.
0 Kudos
KevinHibma
Esri Regular Contributor
Doug,

We just fixed an issue in regards to overwriting a service in the way you mentioned where either the dialogue disappears or ArcMap crashes.
The fix should be in SP2.

Some things you can try to work around the issue (I base these off my personal experience, not saying they'll 100% get around it):
-restart the machine with Desktop

-publish a NEW service
-then go back and try to overwrite the existing service

-delete the contents of your staging folder and try to publish again
(you can find the folder by going to Customize Menu > ArcMap Options > Sharing tab - its the staging path box)

-save your MXD as a new MXD
-close ArcMap, open the new MXD and try to overwrite using this one

Hopefully one of these suggestions gets you around the issue.
0 Kudos
DanMcCoy
Occasional Contributor III
Doug,

We just fixed an issue in regards to overwriting a service in the way you mentioned where either the dialogue disappears or ArcMap crashes.
The fix should be in SP2.



Is there a BUG# for this issue?

Thanks,

Dan
0 Kudos