<?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 error deleting map service with Python/ServerAdmin API - Arc Server 10.2 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-deleting-map-service-with-python-serveradmin/m-p/520700#M40808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to delete a map service on ArcGIS 10.2 for Server using Python 2.7 and&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt; the &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;ArcGIS for Server&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt; Administrator API as shown in this example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000004t000000" rel="nofollow" target="_blank"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not yet been able to successfully run this script.&amp;nbsp; I have tried with and without a token.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the traceback in IDLE when I try the example code with a token:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\me\Desktop\deleteServices.py", line 24, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; deleteservice("myserver", "my map service", None, None, 'token_string')&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\me\Desktop\deleteServices.py", line 18, in deleteservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urllib2.urlopen(delete_service_url, ' ').read() # The ' ' forces POST&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 126, in urlopen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _opener.open(url, data, timeout)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 400, in open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = self._open(req, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 418, in _open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '_open', req)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 378, in _call_chain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = func(*args)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 1207, in http_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.do_open(httplib.HTTPConnection, req)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 1177, in do_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise URLError(err)&lt;/P&gt;&lt;P&gt;URLError: &amp;lt;urlopen error [Errno 11004] getaddrinfo failed&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;..and here is the traceback when I run the same code without a token:&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 88, in urlopen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return opener.open(url, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 209, in open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return getattr(self, name)(url, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 344, in open_http&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.endheaders(data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 954, in endheaders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._send_output(message_body)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 814, in _send_output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.send(msg)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 776, in send&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.connect()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 757, in connect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.timeout, self.source_address)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\socket.py", line 553, in create_connection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for res in getaddrinfo(host, port, 0, SOCK_STREAM):&lt;/P&gt;&lt;P&gt;IOError: [Errno socket error] [Errno 11004] getaddrinfo failed&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to run ArcPy functions to create and start map services on this server successfully.&lt;/P&gt;&lt;P&gt;Has anyone successfully used this example code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Mar 2015 15:02:11 GMT</pubDate>
    <dc:creator>deleted-user-ugCMpXci8bn5</dc:creator>
    <dc:date>2015-03-02T15:02:11Z</dc:date>
    <item>
      <title>error deleting map service with Python/ServerAdmin API - Arc Server 10.2</title>
      <link>https://community.esri.com/t5/python-questions/error-deleting-map-service-with-python-serveradmin/m-p/520700#M40808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to delete a map service on ArcGIS 10.2 for Server using Python 2.7 and&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt; the &lt;/SPAN&gt;&lt;SPAN style="font-size: 12.8000001907349px; color: #4d4d4d; font-family: Arial, Helvetica, sans-serif;"&gt;ArcGIS for Server&lt;/SPAN&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt; Administrator API as shown in this example:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #4d4d4d; font-family: Arial, Helvetica, sans-serif; font-size: 12.8000001907349px;"&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00s30000004t000000" rel="nofollow" target="_blank"&gt;ArcGIS Help (10.2, 10.2.1, and 10.2.2)&lt;/A&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have not yet been able to successfully run this script.&amp;nbsp; I have tried with and without a token.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the traceback in IDLE when I try the example code with a token:&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\me\Desktop\deleteServices.py", line 24, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; deleteservice("myserver", "my map service", None, None, 'token_string')&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\me\Desktop\deleteServices.py", line 18, in deleteservice&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urllib2.urlopen(delete_service_url, ' ').read() # The ' ' forces POST&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 126, in urlopen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return _opener.open(url, data, timeout)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 400, in open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response = self._open(req, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 418, in _open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '_open', req)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 378, in _call_chain&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result = func(*args)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 1207, in http_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return self.do_open(httplib.HTTPConnection, req)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib2.py", line 1177, in do_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; raise URLError(err)&lt;/P&gt;&lt;P&gt;URLError: &amp;lt;urlopen error [Errno 11004] getaddrinfo failed&amp;gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;..and here is the traceback when I run the same code without a token:&lt;/P&gt;&lt;P&gt;........&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 88, in urlopen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return opener.open(url, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 209, in open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return getattr(self, name)(url, data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\urllib.py", line 344, in open_http&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; h.endheaders(data)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 954, in endheaders&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self._send_output(message_body)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 814, in _send_output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.send(msg)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 776, in send&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.connect()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\httplib.py", line 757, in connect&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.timeout, self.source_address)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.2\lib\socket.py", line 553, in create_connection&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for res in getaddrinfo(host, port, 0, SOCK_STREAM):&lt;/P&gt;&lt;P&gt;IOError: [Errno socket error] [Errno 11004] getaddrinfo failed&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to run ArcPy functions to create and start map services on this server successfully.&lt;/P&gt;&lt;P&gt;Has anyone successfully used this example code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2015 15:02:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-deleting-map-service-with-python-serveradmin/m-p/520700#M40808</guid>
      <dc:creator>deleted-user-ugCMpXci8bn5</dc:creator>
      <dc:date>2015-03-02T15:02:11Z</dc:date>
    </item>
  </channel>
</rss>

