Select to view content in your preferred language

Replicating portal content with clone

562
2
03-17-2023 04:49 AM
Jin-taeKim
Occasional Contributor

Hello, I'm trying to clone content from Portal A to Portal B through a clone. I'm writing to ask when the error occurred.

1. from arcgis.gis import GIS
2. gis1 = GIS("https://portal_a.esri.com/portal","contentownerID","contentownerPW") # source portal
3. gis2 = GIS("https://portal_b.esri.com/portal","receivedcontentownerID.","receivedcontentownerPW")
4. item = gis1.content.get('12cnje12ads')   
   # ''In between, there is a content ID.
5. data = [item]
6. gis2.content.clone_items(data,"test")  
# "" In between, there is a Folder Name

The following error occurs when executing this code.

_ItemCreateException Traceback (most recent call last)
In [14]:
Line 1: gis2.content.clone_items(data,"clone")

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\site-packages\arcgis\gis\__init__.py, in clone_items:
Line 7904: 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 1218: 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 446: return self.__get_result()

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

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\thread.py, in run:
Line 58: 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 1191: raise ex

File C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\lib\concurrent\futures\thread.py, in run:
Line 58: 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 3874: raise _ItemCreateException(

_ItemCreateException: ("Failed to create Feature Service assignments_4ff1ca532bd946af845e5bd5a6b909c3: A connection error has occurred: HTTPSConnectionPool(host='gisserver.reprc.co.kr', port=443): Max retries exceeded with url: /server/rest/services/Hosted/assignments_bf1e4/FeatureServer (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001866A1CE700>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))", <Item title:"assignments_bf1e4" type:Feature Layer Collection owner:portaladmin>)

I'm eagerly awaiting your help.
Thank you

from Jin-tae Kim, South-Korea Esri User.

0 Kudos
2 Replies
TrevisMartin
Occasional Contributor

It looks like it is having trouble connecting to the server.  It looks like the source server based on the information in the last paragraph of the error.  It's the 'assignments' layer in particular. 

It could be an issue of authorization or security, the server being busy, or an unstable connection.   If that is the first layer you are trying to copy, then it may be a more general connection issue.  Did the script copy some items then fail on this one?  Or was it unable to copy anything? 

Have you confirmed that you can get a connection to the source portal?

0 Kudos
avonmoos
Regular Contributor

Have you tried...

  1. Check the network connectivity between the two portals: Ensure that the network connection between the two portals is stable and that there are no firewalls or security settings that might be blocking the connection.

  2. Check the server hosting the feature service: Make sure that the server hosting the feature service is up and running and that there are no issues with its configuration or connectivity.

  3. Check the credentials used to access the portals: Ensure that the credentials used to access the portals are correct and have sufficient privileges to perform the cloning operation.

  4. Try cloning a different item: If the issue persists, try cloning a different item from Portal A to Portal B to see if the issue is specific to the item you are trying to clone.

0 Kudos