<?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 Publishing GeoJSON file as web layer works manually in AGOL, fails in Python in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-geojson-file-as-web-layer-works/m-p/1032019#M5631</link>
    <description>&lt;P&gt;I had the following working last week but it's failing today.&amp;nbsp; &amp;nbsp;If it ends up being caused by a change on my side, I'll certainly come clean and post the solution here ... but I don't think anything has changed on my side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, I have the following code in a notebook&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;PSAP='Template'&lt;BR /&gt;file_path = "C:\\LocalDocuments\\files\\file1\\"+PSAP+".geojson"&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;geojson = gis.content.add({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"type": "GeoJson",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"title": 'PSAP '+PSAP+" TEST Layer",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tags": [PSAP,"TEST"]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}, data=file_path)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;geojson&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;lyr_item = geojson.publish()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it fails on the publish() with the following error:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ansi-red-fg"&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)
In  &lt;SPAN class="ansi-blue-fg"&gt;[106]&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;1&lt;/SPAN&gt;:     lyr_item = geojson.publish()

File &lt;SPAN class="ansi-blue-fg"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt;, in &lt;SPAN class="ansi-green-fg"&gt;publish&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;10356&lt;/SPAN&gt;: serviceitem_id = &lt;SPAN class="ansi-cyan-fg"&gt;self&lt;/SPAN&gt;._check_publish_status(ret, folder)

File &lt;SPAN class="ansi-blue-fg"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt;, in &lt;SPAN class="ansi-green-fg"&gt;_check_publish_status&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;10583&lt;/SPAN&gt;: &lt;SPAN class="ansi-blue-fg"&gt;raise&lt;/SPAN&gt; &lt;SPAN class="ansi-cyan-fg"&gt;Exception&lt;/SPAN&gt;(&lt;SPAN class="ansi-yellow-fg"&gt;"&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-fg"&gt;Job failed.&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-fg"&gt;"&lt;/SPAN&gt;)

&lt;SPAN class="ansi-red-fg"&gt;Exception&lt;/SPAN&gt;: Job failed.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what is weird is that if I go to AGOL , the new Layer actually DOES get successfully published?!?&lt;/P&gt;&lt;P&gt;Also, just as a test if I delete the layer in AGOL I can select the GeoJSON item I added in step 2 and successfully publish it without error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I&amp;nbsp; doing something wrong in my publish() call?&lt;/P&gt;</description>
    <pubDate>Tue, 02 Mar 2021 17:55:24 GMT</pubDate>
    <dc:creator>DB_PPF</dc:creator>
    <dc:date>2021-03-02T17:55:24Z</dc:date>
    <item>
      <title>Publishing GeoJSON file as web layer works manually in AGOL, fails in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-geojson-file-as-web-layer-works/m-p/1032019#M5631</link>
      <description>&lt;P&gt;I had the following working last week but it's failing today.&amp;nbsp; &amp;nbsp;If it ends up being caused by a change on my side, I'll certainly come clean and post the solution here ... but I don't think anything has changed on my side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That said, I have the following code in a notebook&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;PSAP='Template'&lt;BR /&gt;file_path = "C:\\LocalDocuments\\files\\file1\\"+PSAP+".geojson"&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;geojson = gis.content.add({&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"type": "GeoJson",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"title": 'PSAP '+PSAP+" TEST Layer",&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;"tags": [PSAP,"TEST"]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}, data=file_path)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;geojson&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE&gt;lyr_item = geojson.publish()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And it fails on the publish() with the following error:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="ansi-red-fg"&gt;Exception&lt;/SPAN&gt;                                 Traceback (most recent call last)
In  &lt;SPAN class="ansi-blue-fg"&gt;[106]&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;1&lt;/SPAN&gt;:     lyr_item = geojson.publish()

File &lt;SPAN class="ansi-blue-fg"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt;, in &lt;SPAN class="ansi-green-fg"&gt;publish&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;10356&lt;/SPAN&gt;: serviceitem_id = &lt;SPAN class="ansi-cyan-fg"&gt;self&lt;/SPAN&gt;._check_publish_status(ret, folder)

File &lt;SPAN class="ansi-blue-fg"&gt;C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py&lt;/SPAN&gt;, in &lt;SPAN class="ansi-green-fg"&gt;_check_publish_status&lt;/SPAN&gt;:
Line &lt;SPAN class="ansi-blue-fg"&gt;10583&lt;/SPAN&gt;: &lt;SPAN class="ansi-blue-fg"&gt;raise&lt;/SPAN&gt; &lt;SPAN class="ansi-cyan-fg"&gt;Exception&lt;/SPAN&gt;(&lt;SPAN class="ansi-yellow-fg"&gt;"&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-fg"&gt;Job failed.&lt;/SPAN&gt;&lt;SPAN class="ansi-yellow-fg"&gt;"&lt;/SPAN&gt;)

&lt;SPAN class="ansi-red-fg"&gt;Exception&lt;/SPAN&gt;: Job failed.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now what is weird is that if I go to AGOL , the new Layer actually DOES get successfully published?!?&lt;/P&gt;&lt;P&gt;Also, just as a test if I delete the layer in AGOL I can select the GeoJSON item I added in step 2 and successfully publish it without error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Am I&amp;nbsp; doing something wrong in my publish() call?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 17:55:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-geojson-file-as-web-layer-works/m-p/1032019#M5631</guid>
      <dc:creator>DB_PPF</dc:creator>
      <dc:date>2021-03-02T17:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Publishing GeoJSON file as web layer works manually in AGOL, fails in Python</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-geojson-file-as-web-layer-works/m-p/1032033#M5633</link>
      <description>&lt;P&gt;Oh, well it was me.&amp;nbsp; Well not really me but my input geojson file was empty.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Mar 2021 18:17:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/publishing-geojson-file-as-web-layer-works/m-p/1032033#M5633</guid>
      <dc:creator>DB_PPF</dc:creator>
      <dc:date>2021-03-02T18:17:31Z</dc:date>
    </item>
  </channel>
</rss>

