Error when cloning Feature Layer (hosted)

536
1
06-27-2022 05:34 AM
Geir-OveBrandal
New Contributor II

I am trying to clone a Feature Layer (hosted) from one organization to another, but I get the following message saying " There is already an object named 'Veilinjer_2d_2021_01_26". But the feature layer does not exist. During the cloning prosess the feature layer is created in the target, but with 0kb and no content. I can delete the feature layer, but I always get the same message. It happens with some feature layers, others is fine.

I get the same problem using ArcGIS Online Assistant, and drag and drop (copy/paste).

Failed to clone.
("Failed to create Feature Service Veilinjer_2d_2021_01_26: Unable to add feature service definition.\nThere is already an object named 'Veilinjer_2d_2021_01_26_000__2021_01_26_15' in the database.\n(Error Code: 400)", <Item title:"Veilinjer_2d_2021_01_26" type:Feature Layer Collection owner:ext_Norconsult_editor>)


My Jupyter Notebook:

 

itemid_list = ["ca65f56b2bb94238b16ddcb0ea3c509c"]

x=1
for itemid in itemid_list:
    file_to_clone = source.content.get(itemid)
    print("******************")
    print("File to clone:")
    print("Title:" , file_to_clone.title)
    print("ID:" , file_to_clone.id)
    print("ULR:" , file_to_clone.url)

    # cloning starts
    print("******************")
    print("cloning")

    try:
        cloned_item = target.content.clone_items(items=[file_to_clone], folder="Transfer_2d")

    except Exception as e:
        print("Failed to clone.")
        print(str(e))

 

 

Tags (2)
0 Kudos
1 Reply
ReshmiMukherjee
New Contributor

I am running into similar issues. Could you figure out the issue.

TAI

0 Kudos