executing PublishMSDToServer with arcserver license failing

574
4
01-25-2011 10:36 AM
BKuiper
Occasional Contributor III
Hi,

i'm trying to execute PublishMSDToServer through a rest endpoint using a arcserver license but this is failing with the following error:

Failed publishing Map Document to Server

It does work when executed with an arceditor license.

I tried changing the license for the rest endpoint by specifying

import arceditor


at the start of the script, but the rest endpoint will try to execute it as arcserver.

So two questions:
- why is PublishMSDToServer not working with an arcserver license; and
- How, as a temporary fix, make sure the script is executed with an arceditor license through an REST endpoint.

So the script is part of a toolbox that is exposed by a rest endpoint on a arcgis server.

Thanks for your feedback!
Tags (2)
0 Kudos
4 Replies
BKuiper
Occasional Contributor III
Solved! It's working fine with the arcserver license. The problem was that the ArcGISSOC user was not part of the agsadmin group. ArcGISSOC is the user that is used to execute the python scripts when executed through the REST endpoint.

I figured this out by re-reading the documentation on PublishMSDToServer that mentioned this possible problem. I got the username of the executing user using the following python code

import os
..
..
arcpy.AddMessage(os.getenv('USERNAME'))
0 Kudos
NadeemQazi
New Contributor III
Hi there

I am running a Pyton script to publish a msd file. this is my coding

import arcpy
try:
msd= r"C:\GeoSpatialTraining\ArcGIS 10\GIS Programming 101\Exercises\crime.msd"
arcpy.mapping.PublishMSDToServer (msd, "http://<NA-LAP-3z8>/arcgis/services", "<NA-LAP-3z8>", "MyMapService", "", ["WMS", "KML"])
except IOError as e:
     print "I/O error({0}): {1} {2}".format(e.errno, e.strerror,e.message)

However it fails to publish the service. Any idea what could possible be wrong. I have shared the folder and also added arcgis user into it. When i tried to publish the service using arcgis server manager it worked and service is published but with the above python script it did not work. I appreciate ur help
0 Kudos
BKuiper
Occasional Contributor III
Hi there

I am running a Pyton script to publish a msd file. this is my coding

import arcpy
try:
msd= r"C:\GeoSpatialTraining\ArcGIS 10\GIS Programming 101\Exercises\crime.msd"
arcpy.mapping.PublishMSDToServer (msd, "http://<NA-LAP-3z8>/arcgis/services", "<NA-LAP-3z8>", "MyMapService", "", ["WMS", "KML"])
except IOError as e:
     print "I/O error({0}): {1} {2}".format(e.errno, e.strerror,e.message)

However it fails to publish the service. Any idea what could possible be wrong. I have shared the folder and also added arcgis user into it. When i tried to publish the service using arcgis server manager it worked and service is published but with the above python script it did not work. I appreciate ur help


Is "<NA-LAP-3z8>" your real host name of the ArcGIS Server ? I hope not. That might be the problem. What error are you getting ?
0 Kudos
BatbayarJargalsaikhan1
New Contributor

hello all, 

I have same situation. here's the error message that i receive.

is there any detail manual to use PublishMSDToServer function or ready to use tool?

thank you, 

Batbayar

0 Kudos