Select to view content in your preferred language

Failed to create Web Map when cloning

626
1
Jump to solution
01-03-2023 02:31 AM
Labels (1)
jorisfrenkel
Occasional Contributor II

Hi,

I am experimenting with cloning content from ArcGIS Online to Portal. I used the samples from https://developers.arcgis.com/python/guide/cloning-content/#the-cloning-process

I succeeded cloning hosted feature layers, web maps and a web mapping application.

However I'm now running into an error when cloning web maps with this line of code (which I used succesfully before):

cloned_wm = target.content.clone_items(items=[testwm],owner="<portal admin username>")

The response is this:

---------------------------------------------------------------------------
_ItemCreateException                      Traceback (most recent call last)
In  [9]:
Line 1:     cloned_wm = target.content.clone_items(items=[testwm],owner="portaladmin")

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in clone_items:
Line 5090:  return deep_cloner.clone()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py, in clone:
Line 748:   results = executor.submit(self._clone, executor).result()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\_base.py, in result:
Line 432:   return self.__get_result()

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\_base.py, in __get_result:
Line 384:   raise self._exception

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\thread.py, in run:
Line 56:    result = self.fn(*self.args, **self.kwargs)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py, in _clone:
Line 735:   raise ex

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\thread.py, in run:
Line 56:    result = self.fn(*self.args, **self.kwargs)

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\_impl\common\_clone.py, in clone:
Line 2253:  raise _ItemCreateException("Failed to create {0} {1}: {2}".format(original_item['type'], original_item['title'], str(ex)), new_item)

_ItemCreateException: ('Failed to create Web Map <name of web map>: 4', None)
---------------------------------------------------------------------------

I am still trying to figure this out, but not getting anywhere so far. If you have any suggestions, please help!

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
jorisfrenkel
Occasional Contributor II

Got it already, the solution was so simple, but for the record I am posting it here.

The web map that I wanted to clone had an invalid layer. After removing that layer, the cloning process worked allright.

 

 

View solution in original post

0 Kudos
1 Reply
jorisfrenkel
Occasional Contributor II

Got it already, the solution was so simple, but for the record I am posting it here.

The web map that I wanted to clone had an invalid layer. After removing that layer, the cloning process worked allright.

 

 

0 Kudos