You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
A clear and concise description of what the bug is.
When I use the code to clone items for feature service and if it has nested repeats I get the error and fails to clone.
To Reproduce
I have a feature service with following
FeatureLayer (id=0)
Table 1(id=1) --> related to layer 0
Table 2(id=2) --> related to Table 1
{
"name": "_ItemCreateException",
"message": "('Failed to create Feature Service SERVICENAME: list index out of range', <Item title:\"TITLE\" type:Feature Layer Collection owner:TARGETUSER>)",
"stack": "---------------------------------------------------------------------------IndexErrorTraceback (mostrecentcalllast)
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyinclone(self)
3924 ]
->3925self._add_features(
3926new_layers,
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyin_add_features(self, layers, relationships, layer_field_mapping, spatial_reference)
2786object_id_field=layers[layer_id].properties[\"objectIdField\"]
->2787object_id_mapping[layer_id] = {
2788layer_features[i][\"attributes\"][object_id_field]: add_results[i][
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyin<dictcomp>(.0)
2787object_id_mapping[layer_id] = {
->2788layer_features[i][\"attributes\"][object_id_field]: add_results[i][
2789 \"objectId\"
IndexError: listindexoutofrangeDuringhandlingoftheaboveexception, anotherexceptionoccurred:
_ItemCreateExceptionTraceback (mostrecentcalllast)
~\\AppData\\Local\\Temp\\ipykernel_29612\\2784937216.pyin<cellline: 16>()
14target_user=\"targetuser\"
15foldername='0_Migration_Test_Folder'--->16cloned_items=target.content.clone_items(items=[it], folder=foldername, owner=target_user, copy_global_ids=True,copy_data=copydata,use_org_basemap=True)#,item_mapping=map_service_item_mapping)1718c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\gis\\__init__.pyinclone_items(self, items, folder, item_extent, use_org_basemap, copy_data, copy_global_ids, search_existing_items, item_mapping, group_mapping, owner, preserve_item_id, **kwargs)
8560wab_code_attach=kwargs.pop(\"copy_code_attachment\", True),
8561 )
->8562returndeep_cloner.clone()
85638564defbulk_update(
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyinclone(self)
1320else:
1321withconcurrent.futures.ThreadPoolExecutor(max_workers=20) asexecutor:
->1322results=executor.submit(self._clone, executor).result()
1323returnresults1324c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\concurrent\\futures\\_base.pyinresult(self, timeout)
444raiseCancelledError()
445elifself._state==FINISHED:
-->446returnself.__get_result()
447else:
448raiseTimeoutError()
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\concurrent\\futures\\_base.pyin__get_result(self)
389ifself._exception:
390try:
-->391raiseself._exception392finally:
393# Break a reference cycle with the exception in self._exceptionc:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\concurrent\\futures\\thread.pyinrun(self)
5657try:
--->58result=self.fn(*self.args, **self.kwargs)
59exceptBaseExceptionasexc:
60self.future.set_exception(exc)
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyin_clone(self, excecutor)
1294ifitem:
1295item.delete()
->1296raiseex12971298level+=1c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\concurrent\\futures\\thread.pyinrun(self)
5657try:
--->58result=self.fn(*self.args, **self.kwargs)
59exceptBaseExceptionasexc:
60self.future.set_exception(exc)
c:\\ProgramFiles\\ArcGIS\\Pro\\bin\\Python\\envs\\arcgispro-py3\\lib\\site-packages\\arcgis\\_impl\\common\\_clone.pyinclone(self)
3994returnnew_item3995exceptExceptionasex:
->3996raise_ItemCreateException(
3997 \"Failedtocreate {0} {1}: {2}\".format(
3998original_item[\"type\"], original_item[\"title\"], str(ex)
_ItemCreateException: ('Failed to create Feature Service SERVICENAME: list index out of range', <Itemtitle:\"TITLE\" type:FeatureLayerCollectionowner:TARGETUSER>)"
}
Platform (please complete the following information):
OS: [Windows 10, ArcGIS Pro 3.2]
Browser [Visual Studio Code]
Python API Version '2.2.0.1'
Additional context
Cloning contents from ArcGIS Enterprise to ArcGIS Online
Also I would like to mention that if the process takes longer than 60 min, it will fail with invalid token error. I tried several ways to see if the expiry time of token to be longer, but I am not able to do so. When using rest API, I am able to have longer expiring token but not with the Python API using "arcgis.gis".
The text was updated successfully, but these errors were encountered:
I also am experiencing this. Using AGOL Notebook, Python 3, cloning S123 items with nested repeats published from Connect, target org is another AGOL. Anything of note to move forward or workflows? The Assistant also fails to clone/copy the content. I have tried SurveyManager with related_items(Survey2Service) and (Survey2Data) method as well with same error.
Describe the bug
A clear and concise description of what the bug is.
When I use the code to clone items for feature service and if it has nested repeats I get the error and fails to clone.
To Reproduce
I have a feature service with following
FeatureLayer (id=0)
Table 1(id=1) --> related to layer 0
Table 2(id=2) --> related to Table 1
Steps to reproduce the behavior:
error:
Platform (please complete the following information):
Additional context
Cloning contents from ArcGIS Enterprise to ArcGIS Online
Also I would like to mention that if the process takes longer than 60 min, it will fail with invalid token error. I tried several ways to see if the expiry time of token to be longer, but I am not able to do so. When using rest API, I am able to have longer expiring token but not with the Python API using "arcgis.gis".
The text was updated successfully, but these errors were encountered: