<?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 when publishing new item to ArcGIS Portal in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-when-publishing-new-item-to-arcgis-portal/m-p/744577#M298</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;I've created a pythonscript which updates several scene services in ArcGIS Portal by deleting the existing scenes and creating&amp;nbsp; new ones. I'm using the arcgis python library. The script work fine when working with one group in Portal, but not when publishing to another group. When executing the script, the first items is being published ok, but the following scenes won't be published. I get this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;[WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\toda\\AppData\\Local\\Temp\\15\\split.part3'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a part of my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 13px;"&gt;lineItems = gis.content.search('title:3D{}_lines'.format(kommuneNr))&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; if lineItems:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;   print("Line exists")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;   for i in range(0, len(lineItems)):&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     lineItem = lineItems&lt;I&gt;&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     itemType = lineItem.type&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     lineItem.delete()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     print("Deleted "+itemType+" for lines")
&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; linePackage_item = gis.content.add(item_properties = linePackage_properties,&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;                                    data = linePackage)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; lineSceneService = linePackage_item.publish()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; linePackage_item.share(groups=gruppe.id)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; lineSceneService.share(groups=gruppe.id)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The traceback shows the error originates in the add_by_part in the gis-module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt; File "C:\Users\XXX\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 3384, in add&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; size=1e7)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; File "C:\Users\XXX\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 3128, in _add_by_part&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; os.remove(ffile)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know what might be wrong? Do I have to manually delete the content of the Temp\15 directory?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 16:52:28 GMT</pubDate>
    <dc:creator>TorbjørnDalløkken2</dc:creator>
    <dc:date>2021-12-12T16:52:28Z</dc:date>
    <item>
      <title>Error when publishing new item to ArcGIS Portal</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/error-when-publishing-new-item-to-arcgis-portal/m-p/744577#M298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;I've created a pythonscript which updates several scene services in ArcGIS Portal by deleting the existing scenes and creating&amp;nbsp; new ones. I'm using the arcgis python library. The script work fine when working with one group in Portal, but not when publishing to another group. When executing the script, the first items is being published ok, but the following scenes won't be published. I get this error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;[WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\toda\\AppData\\Local\\Temp\\15\\split.part3'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is a part of my script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-size: 13px;"&gt;lineItems = gis.content.search('title:3D{}_lines'.format(kommuneNr))&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; if lineItems:&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;   print("Line exists")&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;   for i in range(0, len(lineItems)):&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     lineItem = lineItems&lt;I&gt;&lt;/I&gt;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     itemType = lineItem.type&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     lineItem.delete()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;     print("Deleted "+itemType+" for lines")
&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; linePackage_item = gis.content.add(item_properties = linePackage_properties,&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt;                                    data = linePackage)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; lineSceneService = linePackage_item.publish()&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; linePackage_item.share(groups=gruppe.id)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 13px;"&gt; lineSceneService.share(groups=gruppe.id)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The traceback shows the error originates in the add_by_part in the gis-module:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt; File "C:\Users\XXX\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 3384, in add&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; size=1e7)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; File "C:\Users\XXX\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone\lib\site-packages\arcgis\gis\__init__.py", line 3128, in _add_by_part&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #ff0000;"&gt; os.remove(ffile)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know what might be wrong? Do I have to manually delete the content of the Temp\15 directory?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:52:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/error-when-publishing-new-item-to-arcgis-portal/m-p/744577#M298</guid>
      <dc:creator>TorbjørnDalløkken2</dc:creator>
      <dc:date>2021-12-12T16:52:28Z</dc:date>
    </item>
  </channel>
</rss>

