Select to view content in your preferred language

Error when cloning feature layer with relationships

1205
3
02-07-2022 12:47 PM
Jack_Lim
Emerging Contributor

Does anyone having issue when cloning Feature Service with Relationships?

I was trying to clone a Feature Service that created by Survey123 Connect which contains a couple of Relationships with Tables.

And I keep getting the error showing list index out of range.

'Failed to create Feature Service xxxxx: list index out of range', <Item title:"xxxxx" type:Feature Layer Collection owner:username>

I used the same clone_item tool for all the other content such as web apps, web maps and they all work well. Just wondering if this a bugs or the limitation of that tool.

 

Thanks

3 Replies
MehdiPira1
Esri Contributor

@Jack_Lim ,

This shows that you are not pointing to the right feature service with the right index value.

I recommend first list all the feature services to find the right index of that feature service you are after, then run the code.

0 Kudos
NathanHeickLACSD
Frequent Contributor

Hi Jack,

Have you found a solution to this problem?  I too am trying to clone hosted feature services and some behave differently than others.  I get the list index out of range issue and an authorization error even though I am admin.  It really files like you have to have a complete understanding of feature services in general or try to tackle a small subset of well-behaved ones versus all of them when using the clone_items method.

Also, I was not passing in an invalid index either.

Thanks,
Nathan

Jack_Lim
Emerging Contributor

Hi Nathan,

Unfortunately, based on ESRI's github, the clone_item tool has been archived and no more update since April, 2018. I end up the list index out of range issue of my case as the data structure changes between new and old ArcGIS Enterprise version. I spent times tracing the source code of the clone_item tool and found that the list index on 1 Portal starting with 0 while the other Portal starting from 1.

To deal with this, I'll suggest download the feature service with all its related tables/layers/attachments as well as their relationship classes as a GDB and republish them to the other Portal manually. Unless, you would like to modify the source code of the clone_item tool which is time consuming.

Below is the link to the github page of the clone_item tool.

https://github.com/Esri/ago-clone-items/blob/master/clone_items.py

0 Kudos