Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arcgis.gis.ContentManager clone_items remap_data error IndexError: list index out of range #2206

Open
chrisdel101 opened this issue Jan 23, 2025 · 0 comments
Labels

Comments

@chrisdel101
Copy link

Describe the bug
When calling remap_data I get an error.

Both the src and target IDs that are failing exist in the target portal.
Example w failed IDs:
webmap[0].remap_data({'55e1aa9e034a41c5a7f05c6077ce14e5':'e6d17cef0f21497da6adccac3736bbec'})

To Reproduce
Since it only does it for some ids it's not straightforward to reproduce.
It works for some of the ids, but not for others. I have 5 entries in a dict. It remaps two then fails on the third, even though their is no visible difference between them.

error:

Traceback (most recent call last):
  File "C:\Users\Me\code\source\repos\arcgis-cloner\src\cloners\content_mananger_cloner.py", line 185, in run_content_cloner_webmap_remmapper
    webmap = [item for item in cloned_items if item.type == 'Web Map']  # this is my code here buy rest is source code - this line is not the problem
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\Users\Me\code\source\repos\arcgis-cloner\venv\Lib\site-packages\arcgis\gis\__init__.py", line 17989, in remap_data
    expanded_dict[layer.url] = new_item.layers[i].url
                               ~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "c:\Users\Me\code\source\repos\arcgis-cloner\venv\Lib\site-packages\arcgis\gis\__init__.py", line 17989, in remap_data
    expanded_dict[layer.url] = new_item.layers[i].url
                               ~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Platform (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Python API Version [e.g. 1.6.2] (you can get this by typing print(arcgis.__version__) 2.4.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant