<?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: Exception: Job Failed when publishing csv item in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036454#M5720</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294090"&gt;@JaredPilbeam2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I answered your same question in the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-errors/m-p/1036439#M5719" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-errors/m-p/1036439#M5719&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Mar 2021 03:45:58 GMT</pubDate>
    <dc:creator>MehdiPira1</dc:creator>
    <dc:date>2021-03-15T03:45:58Z</dc:date>
    <item>
      <title>Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036154#M5711</link>
      <description>&lt;P&gt;My post here is a continuation of my other currently unresolved &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-errors/m-p/1035018#M5683" target="_self"&gt;post&lt;/A&gt; pertaining to errors while trying to publish a csv to portal with the ArcGIS Python API-- version 1.8.4. I couldn't publish to ArcGIS Enterprise Portal with this, it throws a KeyError:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from IPython.display import display
from arcgis.gis import GIS
import os
gis = GIS('Home')

csv_file = r'C:\Users\jpilbeam\Downloads\c19_Vaccine_Current.csv'
csv_item = gis.content.add({}, csv_file)#add csv to Portal
csv_layer = csv_item.publish()#&amp;lt;--throws error

KeyError: 'type'&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So now I went this route:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;csv_file = r'C:\Users\jpilbeam\Downloads\c19_Vaccine_Current.csv'
csv_properties={'title':'csvtoportaltest', 'description':'test', 'tags':'python, test'}
test_csv_item = gis.content.add(item_properties=csv_properties, data=csv_file)
csv_feature_layer_item = test_csv_item.publish() #&amp;lt;-- threw error here

Exception: Job failed&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It actually published this time, but on the data page of it it says "There was an error". And the weird thing was, just after I did this the server was down with some 500 error?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="test.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8356i4B0DAB59EA55604E/image-size/large?v=v2&amp;amp;px=999" role="button" title="test.png" alt="test.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 22:20:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036154#M5711</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-03-12T22:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036164#M5712</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/Esri/arcgis-python-api/issues" target="_blank"&gt;Issues · Esri/arcgis-python-api (github.com)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;probably the best place to post an Issue as well&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 22:44:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036164#M5712</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2021-03-12T22:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036181#M5714</link>
      <description>&lt;P&gt;Hi Jared,&lt;/P&gt;&lt;P&gt;I think there might be something wrong about the csv file you are trying to publish. Can you share your csv?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Mar 2021 23:32:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036181#M5714</guid>
      <dc:creator>YuliaMamonova</dc:creator>
      <dc:date>2021-03-12T23:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036198#M5715</link>
      <description>&lt;P&gt;I would try publishing this csv with pro and see if it throws an error.&lt;/P&gt;</description>
      <pubDate>Sat, 13 Mar 2021 00:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036198#M5715</guid>
      <dc:creator>YuliaMamonova</dc:creator>
      <dc:date>2021-03-13T00:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036454#M5720</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/294090"&gt;@JaredPilbeam2&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I answered your same question in the following link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-errors/m-p/1036439#M5719" target="_blank"&gt;https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-errors/m-p/1036439#M5719&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 03:45:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036454#M5720</guid>
      <dc:creator>MehdiPira1</dc:creator>
      <dc:date>2021-03-15T03:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036618#M5721</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/23979"&gt;@YuliaMamonova&lt;/a&gt;Yes, I have been working in Pro most of the time. I've shared my CSV. MehdiPira1 provided me the solution, found &lt;A href="https://community.esri.com/t5/arcgis-api-for-python-questions/publish-csv-to-enterprise-portal-error..." target="_self"&gt;here&lt;/A&gt;. But, this solution only worked on a blank CSV. I still get a KeyError when using the attached CSV. There aren't any special characters that I know of. Thanks for taking a look at it.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 14:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036618#M5721</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-03-15T14:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: Job Failed when publishing csv item</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036642#M5723</link>
      <description>&lt;P&gt;I found out it has something to do with the encoding of the CSV file. I was able to publish the CSV after completing the following steps.&lt;/P&gt;&lt;P&gt;1. open the CSV in a text editor (I used Notepad).&lt;/P&gt;&lt;P&gt;2. use a .csv file extension type --&amp;gt; Save as type: All Files --&amp;gt; Encoding: utf-8&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JaredPilbeam2_0-1615820656386.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/8478i5C5D289E5410A064/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JaredPilbeam2_0-1615820656386.png" alt="JaredPilbeam2_0-1615820656386.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;3. try publishing to Enterprise Portal with this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from IPython.display import display
from arcgis.gis import GIS
import os
gis = GIS('Home') #uses current Notebook as workspace

csv_file = r'C:\pathto\your.csv' #path to CSV
csv_item = gis.content.add({}, csv_file) #add CSV to Enterprise Portal
display(csv_item) #display it here 

#location parameter needs to be set to "none" when publishing to Enterprise Portal
params={"type":"csv","locationType":"none"} 
csv_item.publish(publish_parameters=params) #publish to Enterprise Portal&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not the fastest workflow. If you're able to set the encoding to &lt;EM&gt;utf-8&lt;/EM&gt; back when you originally create your CSV then that would be better.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Mar 2021 15:14:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/exception-job-failed-when-publishing-csv-item/m-p/1036642#M5723</guid>
      <dc:creator>JaredPilbeam2</dc:creator>
      <dc:date>2021-03-15T15:14:59Z</dc:date>
    </item>
  </channel>
</rss>

