<?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 Value Error on connecrtion file to arcgis server in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294852#M22819</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to share/publish an mxd using a python script, and starting by using CreateMapSDDraft.&lt;/P&gt;&lt;P&gt;When I run the script I get "Value Error" followed by the path to the ArcGIS server: &amp;nbsp;'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run my&amp;nbsp;script (using PyScripter) with ArcMap opened using NPLC.mxd,&amp;nbsp;I get an error stating "Cannot get exclusive schema lock. Either being edited or in use by another application". This indicates to me that the path is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked at &lt;A href="http://desktop.arcgis.com/en/arcmap/10.4/analyze/arcpy-mapping/createmapsddraft.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.4/analyze/arcpy-mapping/createmapsddraft.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also looked at &lt;A _jive_internal="true" href="https://community.esri.com/thread/185559-value-error-createmapsddraft"&gt;https://community.esri.com/thread/185559-value-error-createmapsddraft&lt;/A&gt;, which helped me identify that I should be using the full path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is a code snippet, the key line being&lt;/P&gt;&lt;P&gt;con&amp;nbsp;= 'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/P&gt;&lt;P&gt;with the error coming from&lt;/P&gt;&lt;P&gt;analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'ARCGIS_SERVER',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con, True, None, summary, tags)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are most appreciated! I'm a Python newbie so I apologize in advance if this is an obvious error on my part!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Now share NPLC as a service&lt;BR /&gt;# define local variables&lt;BR /&gt;wrkspc = r"C:\\Users\\paa-admin\\Documents\\MapsandGeodatabase\\"&lt;BR /&gt;mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NPLC.mxd')&lt;BR /&gt;con = 'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;BR /&gt;service = 'NPLC'&lt;BR /&gt;sddraft = wrkspc + service + '.sddraft'&lt;BR /&gt;sd = wrkspc + service + '.sd'&lt;BR /&gt;summary = 'PNational Parcel Layer Content'&lt;BR /&gt;tags = 'parcel'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# create service definition draft&lt;BR /&gt;analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'ARCGIS_SERVER',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con, True, None, summary, tags)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Apr 2017 19:10:23 GMT</pubDate>
    <dc:creator>ChuckBenton</dc:creator>
    <dc:date>2017-04-06T19:10:23Z</dc:date>
    <item>
      <title>Value Error on connecrtion file to arcgis server</title>
      <link>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294852#M22819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to share/publish an mxd using a python script, and starting by using CreateMapSDDraft.&lt;/P&gt;&lt;P&gt;When I run the script I get "Value Error" followed by the path to the ArcGIS server: &amp;nbsp;'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run my&amp;nbsp;script (using PyScripter) with ArcMap opened using NPLC.mxd,&amp;nbsp;I get an error stating "Cannot get exclusive schema lock. Either being edited or in use by another application". This indicates to me that the path is valid.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked at &lt;A href="http://desktop.arcgis.com/en/arcmap/10.4/analyze/arcpy-mapping/createmapsddraft.htm"&gt;http://desktop.arcgis.com/en/arcmap/10.4/analyze/arcpy-mapping/createmapsddraft.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also looked at &lt;A _jive_internal="true" href="https://community.esri.com/thread/185559-value-error-createmapsddraft"&gt;https://community.esri.com/thread/185559-value-error-createmapsddraft&lt;/A&gt;, which helped me identify that I should be using the full path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following is a code snippet, the key line being&lt;/P&gt;&lt;P&gt;con&amp;nbsp;= 'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/P&gt;&lt;P&gt;with the error coming from&lt;/P&gt;&lt;P&gt;analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'ARCGIS_SERVER',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con, True, None, summary, tags)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions are most appreciated! I'm a Python newbie so I apologize in advance if this is an obvious error on my part!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Now share NPLC as a service&lt;BR /&gt;# define local variables&lt;BR /&gt;wrkspc = r"C:\\Users\\paa-admin\\Documents\\MapsandGeodatabase\\"&lt;BR /&gt;mapDoc = arcpy.mapping.MapDocument(wrkspc + 'NPLC.mxd')&lt;BR /&gt;con = 'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;BR /&gt;service = 'NPLC'&lt;BR /&gt;sddraft = wrkspc + service + '.sddraft'&lt;BR /&gt;sd = wrkspc + service + '.sd'&lt;BR /&gt;summary = 'PNational Parcel Layer Content'&lt;BR /&gt;tags = 'parcel'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# create service definition draft&lt;BR /&gt;analysis = arcpy.mapping.CreateMapSDDraft(mapDoc, sddraft, service, 'ARCGIS_SERVER',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; con, True, None, summary, tags)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 19:10:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294852#M22819</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2017-04-06T19:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: Value Error on connecrtion file to arcgis server</title>
      <link>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294853#M22820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;well this is what I got with your con path... albeit I was using python 3, but it appears that raw formatting might help&lt;/P&gt;&lt;P&gt;if not, it is a good habit to get into.&amp;nbsp; See if this improves things...&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;con &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/SPAN&gt;
&amp;nbsp; File &lt;SPAN class="string token"&gt;"&amp;lt;ipython-input-49-49f1dbc4e1cb&amp;gt;"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; line &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; con &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="operator token"&gt;^&lt;/SPAN&gt;
SyntaxError&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;unicode error&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'unicodeescape'&lt;/SPAN&gt; codec can't decode bytes &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; position &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; truncated \UXXXXXXXX escape

&lt;SPAN class="comment token"&gt;# a little 'r' goes a long way sometimes&lt;/SPAN&gt;

con &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\Users\paa-admin\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\arcgis on paa-server_6080 (admin).ags'&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:10:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294853#M22820</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T14:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: Value Error on connecrtion file to arcgis server</title>
      <link>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294854#M22821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That was it!!!&amp;nbsp; Further proof of my newbie status... I know all about the 'r' but for some reason overlooked it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chuck&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Apr 2017 20:12:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/value-error-on-connecrtion-file-to-arcgis-server/m-p/294854#M22821</guid>
      <dc:creator>ChuckBenton</dc:creator>
      <dc:date>2017-04-06T20:12:43Z</dc:date>
    </item>
  </channel>
</rss>

