<?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: &amp;quot;Map Service register Layers&amp;quot; python script error in ArcGIS Hub Questions</title>
    <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166673#M910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I try to run the new version against your service, I get this stack trace.&amp;nbsp; Maybe there is some sort of network equipment that is blocking certain requests?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\scot5141\Documents\GitHub\OpenData-MapServiceLayerRegistrar\registerLayers2.py", line 20, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for serviceLayer in fs.layers:&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\ags\mapservice.py", line 210, in layers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.__init()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\ags\mapservice.py", line 77, in __init&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proxy_url=self._proxy_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\web\_base.py", line 153, in _do_get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp = opener.open(format_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\urllib2.py", line 404, 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.3\lib\urllib2.py", line 422, 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.3\lib\urllib2.py", line 382, 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.3\lib\urllib2.py", line 1214, 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.3\lib\urllib2.py", line 1187, in do_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = h.getresponse(buffering=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 1067, in getresponse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response.begin()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 409, in begin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version, status, reason = self._read_status()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 365, in _read_status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line = self.fp.readline(_MAXLINE + 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\socket.py", line 476, in readline&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = self._sock.recv(self._rbufsize)&lt;/P&gt;&lt;P&gt;error: [Errno 10054] An existing connection was forcibly closed by the remote host&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Mar 2015 22:28:04 GMT</pubDate>
    <dc:creator>ScottMoore__Olympia_</dc:creator>
    <dc:date>2015-03-20T22:28:04Z</dc:date>
    <item>
      <title>"Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166666#M903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been using &lt;A href="https://github.com/sirws/OpenData-MapServiceLayerRegistrar"&gt;this script &lt;/A&gt;successfully for months now to register large Map Services in ArcGIS Online to be included in OpenData, but recently (the last couple of weeks) I've been receiving this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {'error':{'messageCode': 'CONT_0057', 'message': "Invalid JSON in 'text' parameter.", 'code': 400, 'details': []}}&lt;/P&gt;&lt;P&gt;I don't think anything has changed on my machine(s) and I'm not doing anything differently when creating my Map Service.&amp;nbsp; What am I doing wrong?&amp;nbsp; I've attached the whole python script.&lt;IMG alt="MapServiceLayerRegistrar.jpg" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/72117_MapServiceLayerRegistrar.jpg" style="width: 620px; height: 370px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14260190699697466" data-renderedposition="528_8_912_0" jivemacro_uid="_14260190699697466"&gt;&lt;P&gt;&lt;/P&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Mar 2015 20:31:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166666#M903</guid>
      <dc:creator>ChristopherBoland</dc:creator>
      <dc:date>2015-03-10T20:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166667#M904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chris,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; I'm experiencing the same as you. If I get an answer I'll post here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt (our site is opendata.dc.gov)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 15:14:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166667#M904</guid>
      <dc:creator>MattCrossett</dc:creator>
      <dc:date>2015-03-19T15:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166668#M905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you add a Try/ Except block around the res = agol.addItem... line of code?&lt;/P&gt;&lt;P&gt;In the except block it would be useful to Print serviceLayer.name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will help us debug what's being sent over to AGOL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Mar 2015 18:43:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166668#M905</guid>
      <dc:creator>DanielFenton1</dc:creator>
      <dc:date>2015-03-19T18:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166669#M906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.esri.com/migrated-users/44083"&gt;Daniel Fenton&lt;/A&gt;​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion.&amp;nbsp; As you said, I added the try statement before the indicated lines of code and added the&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print serviceLayer.name&lt;/P&gt;&lt;P&gt;statement after it and received the same results.&amp;nbsp; It runs through all of the items in the service, prints the feature class name and the feature class description, then throws this error:&lt;/P&gt;&lt;P&gt;{'error': {'messageCode': 'CONT_0057', 'message': "Invalid JSON in 'text' parameter.", 'code': 400, 'details': []}}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would you rather work offline with this?&amp;nbsp; Also, FYI, I also put a note on GitHub and received an email from &lt;A href="https://community.esri.com/migrated-users/3680"&gt;Scott Moore&lt;/A&gt; (the code developer) yesterday saying that he would try to look into it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 13:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166669#M906</guid>
      <dc:creator>ChristopherBoland</dc:creator>
      <dc:date>2015-03-20T13:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166670#M907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, but what is the name of the service?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 19:12:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166670#M907</guid>
      <dc:creator>DanielFenton1</dc:creator>
      <dc:date>2015-03-20T19:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166671#M908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I'm saying.&amp;nbsp; The script runs through all of the layers in the web mapping service, lists the name of the layers, lists the description of the layers, but doesn't create an AGOL item for any of them and throws the error.&amp;nbsp; It is not any one particular layer in the service and has occurred on many different web mapping services too, so not service specific.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently I am trying it on this service:&lt;/P&gt;&lt;P&gt;&lt;A href="http://ocean.floridamarine.org/arcgis/rest/services/Oil_Spill/ACPGRP/MapServer"&gt;http://ocean.floridamarine.org/arcgis/rest/services/Oil_Spill/ACPGRP/MapServer&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached is the result of the script after running in IDLE:&lt;IMG alt="script failure.jpg" class="image-1 jive-image" src="/legacyfs/online/76241_script failure.jpg" style="width: 620px; height: 422px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 19:50:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166671#M908</guid>
      <dc:creator>ChristopherBoland</dc:creator>
      <dc:date>2015-03-20T19:50:38Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166672#M909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey there!&amp;nbsp; I just added a new script on GitHub that uses the latest version of ArcREST.&amp;nbsp; You can find it here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/sirws/OpenData-MapServiceLayerRegistrar/blob/master/registerLayers2.py" title="https://github.com/sirws/OpenData-MapServiceLayerRegistrar/blob/master/registerLayers2.py"&gt;here.&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to download the latest version of ArcREST as well.&amp;nbsp; I made a note in the ReadMe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 22:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166672#M909</guid>
      <dc:creator>ScottMoore__Olympia_</dc:creator>
      <dc:date>2015-03-20T22:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166673#M910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I try to run the new version against your service, I get this stack trace.&amp;nbsp; Maybe there is some sort of network equipment that is blocking certain requests?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Users\scot5141\Documents\GitHub\OpenData-MapServiceLayerRegistrar\registerLayers2.py", line 20, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for serviceLayer in fs.layers:&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\ags\mapservice.py", line 210, in layers&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; self.__init()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\ags\mapservice.py", line 77, in __init&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; proxy_url=self._proxy_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\site-packages\arcrest\web\_base.py", line 153, in _do_get&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp = opener.open(format_url)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\urllib2.py", line 404, 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.3\lib\urllib2.py", line 422, 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.3\lib\urllib2.py", line 382, 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.3\lib\urllib2.py", line 1214, 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.3\lib\urllib2.py", line 1187, in do_open&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = h.getresponse(buffering=True)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 1067, in getresponse&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; response.begin()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 409, in begin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; version, status, reason = self._read_status()&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\httplib.py", line 365, in _read_status&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; line = self.fp.readline(_MAXLINE + 1)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "C:\Python27\ArcGIS10.3\lib\socket.py", line 476, in readline&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data = self._sock.recv(self._rbufsize)&lt;/P&gt;&lt;P&gt;error: [Errno 10054] An existing connection was forcibly closed by the remote host&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2015 22:28:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166673#M910</guid>
      <dc:creator>ScottMoore__Olympia_</dc:creator>
      <dc:date>2015-03-20T22:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166674#M911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looking at the Add Item API documentation  you’ll see that there is a “text” option for Items. That is likely what the error is responding to. However you are not explicitly trying to include a text parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use Fiddler or other to capture the JSON being sent to AGOL – that would be the best way to see what you are sending. I’m curious if a “text” is getting added in the ArcREST (though looking at the source I don’t see that).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatively you could add a text parameter that is a blank string. Maybe AGOL is now expecting the parameter (though it probably shouldn’t).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Add_Item/02r30000008q000000/&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Mar 2015 01:52:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166674#M911</guid>
      <dc:creator>AndrewTurner</dc:creator>
      <dc:date>2015-03-21T01:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: "Map Service register Layers" python script error</title>
      <link>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166675#M912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Scott! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I downloaded the new version of your script and installed ArcRest v2 and it ran perfectly on that rest endpoint.&amp;nbsp; I don't know why you were getting the stack trace, but it worked fine for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2015 14:32:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-hub-questions/quot-map-service-register-layers-quot-python/m-p/166675#M912</guid>
      <dc:creator>ChristopherBoland</dc:creator>
      <dc:date>2015-03-23T14:32:08Z</dc:date>
    </item>
  </channel>
</rss>

