Select to view content in your preferred language

Clone_items on webmap containing hosted view fails on 2.4.1

89
1
Jump to solution
Wednesday
Labels (1)
RichardHowe
Frequent Contributor

When using the gis.content.clone_items command in the API we consistently see the error below when running it on a webmap in ArcGIS Online containing a hosted view layer. with parameters set to:
"(copy_data=True, search_existing_items=False)"

Traceback (most recent call last):
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_clone.py", line 3404, in clone
    and "viewLayerDefinition" in layer["adminLayerInfo"]
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable



The same command works perfectly on version 2.3.0 of the API, the clone completes and it clones both the webmap and hosted view layer correctly, so this seems like a new bug introduced in the API

Tags (4)
0 Kudos
1 Solution

Accepted Solutions
RichardHowe
Frequent Contributor

For anyone that lands here. ESRI have acknowledged this as a bug:

BUG-000177674

The workaround seems to be to fire the clone command from an AGOL notebook, which doesn't generate the error. Which is a little bit cumbersome in my use case as I have had to rewrite a Pro tool box and move half the code to an AGOL note book, but it does work.

View solution in original post

0 Kudos
1 Reply
RichardHowe
Frequent Contributor

For anyone that lands here. ESRI have acknowledged this as a bug:

BUG-000177674

The workaround seems to be to fire the clone command from an AGOL notebook, which doesn't generate the error. Which is a little bit cumbersome in my use case as I have had to rewrite a Pro tool box and move half the code to an AGOL note book, but it does work.

0 Kudos