<?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: User folder not found (Error code: 400) using story.duplicate() via python api in ArcGIS StoryMaps Questions</title>
    <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1393304#M4559</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/745726"&gt;@atmosfairy&lt;/a&gt;&amp;nbsp; have you tried creating the new StoryMap using &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.storymap.html#storymap:~:text=copy_content(target_story,%C2%B6" target="_self"&gt;copy_content&lt;/A&gt;? You could use this to copy all the content in your Template, into the new story.&lt;BR /&gt;&lt;BR /&gt;Another thing you could try is to set permission inheritance for resources in the item that you can get with sm._item.resources.list():&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for resourcedata in resources:
    resource_name = resourcedata['resource']
    if '.json' not in resource_name:
        existing_story._item.resources.get(resource_name, out_folder="/arcgis/home/")
    else:
        print(resource_name)
        resource_json = existing_story._item.resources.get(resource_name, try_json=True)
        with open(f"/arcgis/home/{resource_name}","w") as jsonfile:
            json.dump(resource_json, jsonfile)
    existing_story._item.resources.update(file=f"/arcgis/home/{resource_name}",properties={"access":"inherit"})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Mar 2024 17:36:53 GMT</pubDate>
    <dc:creator>ThePreatorian</dc:creator>
    <dc:date>2024-03-08T17:36:53Z</dc:date>
    <item>
      <title>Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1391531#M4546</link>
      <description>&lt;P&gt;I have created a storymap template and shared it with a Shared Update group so that others can duplicate and populate the template by way of a semi-automated python tool. As the content owner, I can duplicate, update, save and share the template, but when others attempt to do the same, the aforementioned exception is thrown at sm.duplicate(). The result is a copy of the original template in the root folder (i.e. 'All My Content) of the user that cannot be opened or deleted.&amp;nbsp;&lt;SPAN&gt;I could possibly ignore the error and move on, but would like to know if there is a better way of getting around this exception by defining a user folder; or something else? Any adivce appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Note I am using arcgis 2.2.0. and ArcGIS Enterprise 10.9.1.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Mar 2024 22:42:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1391531#M4546</guid>
      <dc:creator>atmosfairy</dc:creator>
      <dc:date>2024-03-05T22:42:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1392101#M4548</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/745726"&gt;@atmosfairy&lt;/a&gt;,&amp;nbsp;looks like you have a good use case for python.&lt;BR /&gt;I think I am able to reproduce on my end, but wanted to confirm the error you are seeing.&lt;BR /&gt;Are you getting a straight 400 error or the 404 error. Is there an additional message?&lt;BR /&gt;&lt;BR /&gt;If you are willing, could you list the block types in your template story?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 20:07:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1392101#M4548</guid>
      <dc:creator>ThePreatorian</dc:creator>
      <dc:date>2024-03-06T20:07:14Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1392218#M4550</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/538421"&gt;@ThePreatorian&lt;/a&gt;&amp;nbsp;- Block types include: Storycover, Navigation, Sidecar (with map element and text nodes) and an image gallery.&lt;/P&gt;&lt;P&gt;Can confirm it is the Exception: User folder does not exist. (Error Code: 400)&lt;/P&gt;&lt;P&gt;Also, despite the creator not being able to open the item, when it is shared with the update group, I can see the item and open it successfully, even though I am not the owner of the new copy.&lt;/P&gt;&lt;P&gt;Further, the administrators also cannot view the duplicated item details, but can open and configure the storymap. However, any duplicated 'ghost' items cannot be deleted by owner or administrators - error message reads: 'Delete - The following items can't be deleted becasue they are delete protected or have dependent items'.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2024 21:27:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1392218#M4550</guid>
      <dc:creator>atmosfairy</dc:creator>
      <dc:date>2024-03-07T21:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1393304#M4559</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/745726"&gt;@atmosfairy&lt;/a&gt;&amp;nbsp; have you tried creating the new StoryMap using &lt;A href="https://developers.arcgis.com/python/api-reference/arcgis.apps.storymap.html#storymap:~:text=copy_content(target_story,%C2%B6" target="_self"&gt;copy_content&lt;/A&gt;? You could use this to copy all the content in your Template, into the new story.&lt;BR /&gt;&lt;BR /&gt;Another thing you could try is to set permission inheritance for resources in the item that you can get with sm._item.resources.list():&lt;/P&gt;&lt;LI-CODE lang="python"&gt;for resourcedata in resources:
    resource_name = resourcedata['resource']
    if '.json' not in resource_name:
        existing_story._item.resources.get(resource_name, out_folder="/arcgis/home/")
    else:
        print(resource_name)
        resource_json = existing_story._item.resources.get(resource_name, try_json=True)
        with open(f"/arcgis/home/{resource_name}","w") as jsonfile:
            json.dump(resource_json, jsonfile)
    existing_story._item.resources.update(file=f"/arcgis/home/{resource_name}",properties={"access":"inherit"})&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Mar 2024 17:36:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1393304#M4559</guid>
      <dc:creator>ThePreatorian</dc:creator>
      <dc:date>2024-03-08T17:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1400723#M4601</link>
      <description>&lt;P&gt;Hi @ThePretotorian - thanks for getting back to me and sorry for the delayed response! Unfortunately, neither of these options work for me (for different reasons). I figured the simplest and most efficient work-around in this instance is to create multiple templates and reassign them to different users. If this is indeed a bug, I am happy to document the current workflow process, errors and traceback and log it through our administration account if that is best?&lt;/P&gt;&lt;P&gt;Thanks again&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":vulcan_salute:"&gt;🖖&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2024 03:50:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1400723#M4601</guid>
      <dc:creator>atmosfairy</dc:creator>
      <dc:date>2024-03-26T03:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1405206#M4624</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/745726"&gt;@atmosfairy&lt;/a&gt;&amp;nbsp; Good to hear there is a workaround.&lt;BR /&gt;&lt;BR /&gt;I know the python team released some improvements to the `duplicate`, `clone_items`, `copy_item` methods with the release of 2.3.0&lt;BR /&gt;&lt;BR /&gt;You could consider upgrading to 2.3.0 and trying the workflow again&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:16:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1405206#M4624</guid>
      <dc:creator>ThePreatorian</dc:creator>
      <dc:date>2024-04-03T14:16:42Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1406972#M4639</link>
      <description>&lt;P&gt;Will do - hopeful the upgrade will improve the process as well as my mental health&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 22:54:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1406972#M4639</guid>
      <dc:creator>atmosfairy</dc:creator>
      <dc:date>2024-04-07T22:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Exception: User folder not found (Error code: 400) using story.duplicate() via python api</title>
      <link>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1406973#M4640</link>
      <description>&lt;P&gt;Will do - hopeful the upgrade will improve the process as well as my mental health&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Apr 2024 22:55:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-storymaps-questions/exception-user-folder-not-found-error-code-400/m-p/1406973#M4640</guid>
      <dc:creator>atmosfairy</dc:creator>
      <dc:date>2024-04-07T22:55:55Z</dc:date>
    </item>
  </channel>
</rss>

