<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: executing PublishMSDToServer with arcserver license failing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413200#M32528</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
..
..
arcpy.AddMessage(os.getenv('USERNAME'))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 18:44:59 GMT</pubDate>
    <dc:creator>BKuiper</dc:creator>
    <dc:date>2021-12-11T18:44:59Z</dc:date>
    <item>
      <title>executing PublishMSDToServer with arcserver license failing</title>
      <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413199#M32527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;i'm trying to execute PublishMSDToServer through a rest endpoint using a arcserver license but this is failing with the following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Failed publishing Map Document to Server&lt;/STRONG&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It does work when executed with an arceditor license.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried changing the license for the rest endpoint by specifying&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arceditor&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;at the start of the script, but the rest endpoint will try to execute it as arcserver.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So two questions:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- why is PublishMSDToServer not working with an arcserver license; and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- How, as a temporary fix, make sure the script is executed with an arceditor license through an REST endpoint.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So the script is part of a toolbox that is exposed by a rest endpoint on a arcgis server.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your feedback!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jan 2011 18:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413199#M32527</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2011-01-25T18:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: executing PublishMSDToServer with arcserver license failing</title>
      <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413200#M32528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;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.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import os
..
..
arcpy.AddMessage(os.getenv('USERNAME'))&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 18:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413200#M32528</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2021-12-11T18:44:59Z</dc:date>
    </item>
    <item>
      <title>Re: executing PublishMSDToServer with arcserver license failing</title>
      <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413201#M32529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi there&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am running a Pyton script to publish a msd file. this is my coding&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; msd= r"C:\GeoSpatialTraining\ArcGIS 10\GIS Programming 101\Exercises\crime.msd"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt; arcpy.mapping.PublishMSDToServer (msd, "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;NA-LAP-3z8&amp;gt;/arcgis/services", "&amp;lt;NA-LAP-3z8&amp;gt;", "MyMapService", "", ["WMS", "KML"])&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;except IOError as e:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I/O error({0}): {1} {2}".format(e.errno, e.strerror,e.message)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;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&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2012 10:32:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413201#M32529</guid>
      <dc:creator>NadeemQazi</dc:creator>
      <dc:date>2012-07-12T10:32:04Z</dc:date>
    </item>
    <item>
      <title>Re: executing PublishMSDToServer with arcserver license failing</title>
      <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413202#M32530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi there&lt;BR /&gt;&lt;BR /&gt;I am running a Pyton script to publish a msd file. this is my coding&lt;BR /&gt;&lt;BR /&gt;import arcpy&lt;BR /&gt;try:&lt;BR /&gt; msd= r"C:\GeoSpatialTraining\ArcGIS 10\GIS Programming 101\Exercises\crime.msd"&lt;BR /&gt; arcpy.mapping.PublishMSDToServer (msd, "http://&amp;lt;NA-LAP-3z8&amp;gt;/arcgis/services", "&amp;lt;NA-LAP-3z8&amp;gt;", "MyMapService", "", ["WMS", "KML"])&lt;BR /&gt;except IOError as e:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print "I/O error({0}): {1} {2}".format(e.errno, e.strerror,e.message)&lt;BR /&gt;&lt;BR /&gt;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&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is "&amp;lt;NA-LAP-3z8&amp;gt;" your real host name of the ArcGIS Server ? I hope not. That might be the problem. What error are you getting ?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2012 11:45:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413202#M32530</guid>
      <dc:creator>BKuiper</dc:creator>
      <dc:date>2012-07-12T11:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: executing PublishMSDToServer with arcserver license failing</title>
      <link>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413203#M32531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have same situation. here's the error message that i receive.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/380769_PythonError.PNG" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there any detail manual to use PublishMSDToServer function or ready to use tool?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Batbayar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 04:08:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/executing-publishmsdtoserver-with-arcserver/m-p/413203#M32531</guid>
      <dc:creator>BatbayarJargalsaikhan1</dc:creator>
      <dc:date>2017-10-20T04:08:30Z</dc:date>
    </item>
  </channel>
</rss>

