<?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 ValureError - Circular reference when publishing to an ArcGIS server using the python api 1.4.2  in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/valureerror-circular-reference-when-publishing-to/m-p/766072#M536</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;Has anyone had a circular reference issue when publishing to an ArcGIS server using the python api 1.4.2? The information of the issue is below.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;&lt;STRONG&gt;Git Hub Ref&lt;/STRONG&gt; -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-python-api/issues/270" title="https://github.com/Esri/arcgis-python-api/issues/270"&gt;ValueError - Circular Reference - gis.admin.servers Publish SD · Issue #270 · Esri/arcgis-python-api · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;What i'm trying to do&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- Publish a MapImageSD file to the ArcGIS Server.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- Publishing an SD file to the arcgis enterprise server causes a ValueError: Circular Reference Detected. The circular reference occurs in the module _connection.py on line 198. Here a json.dumps(val) method id failing. The "val" response variable is returning&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;&lt;SPAN&gt;{'f': 'json', 'in_config_overwrite': '', 'in_publish_options': '', 'in_sdp_id': &amp;lt;Recursion on dict with id=1988743734832&amp;gt;, 'self': &amp;lt;Toolbox url:"&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/[domain]/arcgis/rest/services/System/PublishingTools/GPServer" rel="nofollow" target="_blank"&gt;https://[domain]/arcgis/rest/services/System/PublishingTools/GPServer&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;'in_sdp_id' seems to be causing the issue.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;gis = GIS(config["gis"]["portal_url"], config["gis"]["username"], config["gis"]["password"]) gis_servers = gis.admin.servers.list() server1 = gis_servers[0] server1.services.publish_sd(sd_file='C:/Projects/TestOutput/MapImageSharingDraftExample.sd', folder=None)&lt;/CODE&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;Traceback (most recent call last): File "c:\Projects\project\Phase 1\repositories\Automation\content\createContent.py", line 118, in &amp;lt;module&amp;gt; build(config=json_config, username=username, password=password) File "c:\Projects\project\Phase 1\repositories\Automation\content\createContent.py", line 54, in build folder=None) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\admin\_services.py", line 252, in publish_sd return self._sm.publish_sd(sd_file, folder) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\admin\administration.py", line 181, in publish_sd res = service.publish_service_definition(in_sdp_id=uid) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\geoprocessing\_tool.py", line 97, in publish_service_definition return self._execute(kwargs) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\geoprocessing\_tool.py", line 989, in _execute job_info = self._con.post(submit_url, gp_params, token=self._token) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 864, in post postdata = {k: jsonize_dict(v) for k, v in postdata.items()} File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 864, in &amp;lt;dictcomp&amp;gt; postdata = {k: jsonize_dict(v) for k, v in postdata.items()} File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 198, in jsonize_dict return json.dumps(val) File "C:\anaconda3\envs\project\lib\json\__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "C:\anaconda3\envs\project\lib\json\encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\anaconda3\envs\project\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) ValueError: Circular reference detected&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Jul 2018 10:12:16 GMT</pubDate>
    <dc:creator>MatthewLewis3</dc:creator>
    <dc:date>2018-07-12T10:12:16Z</dc:date>
    <item>
      <title>ValureError - Circular reference when publishing to an ArcGIS server using the python api 1.4.2</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/valureerror-circular-reference-when-publishing-to/m-p/766072#M536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;Has anyone had a circular reference issue when publishing to an ArcGIS server using the python api 1.4.2? The information of the issue is below.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;&lt;STRONG&gt;Git Hub Ref&lt;/STRONG&gt; -&amp;nbsp;&lt;A class="link-titled" href="https://github.com/Esri/arcgis-python-api/issues/270" title="https://github.com/Esri/arcgis-python-api/issues/270"&gt;ValueError - Circular Reference - gis.admin.servers Publish SD · Issue #270 · Esri/arcgis-python-api · GitHub&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-top: 0px !important; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;What i'm trying to do&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- Publish a MapImageSD file to the ArcGIS Server.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;- Publishing an SD file to the arcgis enterprise server causes a ValueError: Circular Reference Detected. The circular reference occurs in the module _connection.py on line 198. Here a json.dumps(val) method id failing. The "val" response variable is returning&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;&lt;SPAN&gt;{'f': 'json', 'in_config_overwrite': '', 'in_publish_options': '', 'in_sdp_id': &amp;lt;Recursion on dict with id=1988743734832&amp;gt;, 'self': &amp;lt;Toolbox url:"&lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/[domain]/arcgis/rest/services/System/PublishingTools/GPServer" rel="nofollow" target="_blank"&gt;https://[domain]/arcgis/rest/services/System/PublishingTools/GPServer&lt;/A&gt;&lt;SPAN&gt;"&amp;gt;}&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;'in_sdp_id' seems to be causing the issue.&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Code&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;gis = GIS(config["gis"]["portal_url"], config["gis"]["username"], config["gis"]["password"]) gis_servers = gis.admin.servers.list() server1 = gis_servers[0] server1.services.publish_sd(sd_file='C:/Projects/TestOutput/MapImageSharingDraftExample.sd', folder=None)&lt;/CODE&gt;&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 16px;"&gt;&lt;SPAN style="font-weight: 600;"&gt;&lt;STRONG&gt;Output&lt;/STRONG&gt;&lt;/SPAN&gt;:&lt;/P&gt;&lt;P style="color: #24292e; background-color: #ffffff; margin-bottom: 0px !important;"&gt;&lt;CODE style="background-color: rgba(27, 31, 35, 0.05); padding: 0.2em 0.4em;"&gt;Traceback (most recent call last): File "c:\Projects\project\Phase 1\repositories\Automation\content\createContent.py", line 118, in &amp;lt;module&amp;gt; build(config=json_config, username=username, password=password) File "c:\Projects\project\Phase 1\repositories\Automation\content\createContent.py", line 54, in build folder=None) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\admin\_services.py", line 252, in publish_sd return self._sm.publish_sd(sd_file, folder) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\admin\administration.py", line 181, in publish_sd res = service.publish_service_definition(in_sdp_id=uid) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\geoprocessing\_tool.py", line 97, in publish_service_definition return self._execute(kwargs) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\geoprocessing\_tool.py", line 989, in _execute job_info = self._con.post(submit_url, gp_params, token=self._token) File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 864, in post postdata = {k: jsonize_dict(v) for k, v in postdata.items()} File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 864, in &amp;lt;dictcomp&amp;gt; postdata = {k: jsonize_dict(v) for k, v in postdata.items()} File "C:\anaconda3\envs\project\lib\site-packages\arcgis\gis\server\_common\_connection.py", line 198, in jsonize_dict return json.dumps(val) File "C:\anaconda3\envs\project\lib\json\__init__.py", line 231, in dumps return _default_encoder.encode(obj) File "C:\anaconda3\envs\project\lib\json\encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "C:\anaconda3\envs\project\lib\json\encoder.py", line 257, in iterencode return _iterencode(o, 0) ValueError: Circular reference detected&lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2018 10:12:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/valureerror-circular-reference-when-publishing-to/m-p/766072#M536</guid>
      <dc:creator>MatthewLewis3</dc:creator>
      <dc:date>2018-07-12T10:12:16Z</dc:date>
    </item>
  </channel>
</rss>

