-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Describe the bug
When attempting to clone a hosted feature layer containing attachments from one ArcGIS Portal to another using the clone_items method of the ArcGIS Python API, the process fails with an error. Although the hosted feature layer appears to be successfully cloned initially, the operation ends with an "Unexpected error" in the logs. The error indicates an issue with deleting an intermediate item (i8f6b82a9-3b82-4b11-8af2-2e72e72d5f1a)
during the cloning process.
The logs show the following key points:
- Attachments are uploaded and committed successfully.
- An error occurs when attempting to delete a temporary or intermediate item related to the hosted feature layer.
- A subsequent error arises when creating the final feature service, resulting in the deletion of the newly created item in the target portal.
Note: The confidence check during the clone_items process takes an unusually long time, which may impact overall performance and cloning duration.
To Reproduce
Steps to reproduce the behavior:
from arcgis.gis import GIS
old_portal = GIS('https://arcgis.example.com/portal',username='alanyonetimi',password='****')
print("eski portal login oldu")
new_portal = GIS('https://gis.example.com/portal',username='portaladmin',password='****')
print("yeni portal login oldu")
analiz_lokasyon = old_portal.content.search("title:analiz lokasyon")
analok = analiz_lokasyon[2]
analok_clone = new_portal.content.clone_items(items = [analok], owner="portaladmin")
error:
2024-11-25 17:26:47,467 - DEBUG - https://gis.ispark.istanbul:443 "POST /server/rest/services/Hosted/AnalizLokasyon/FeatureServer/uploads/i8f6b82a9-3b82-4b11-8af2-2e72e72d5f1a/commit HTTP/11" 200 239
2024-11-25 17:26:49,217 - DEBUG - https://gis.ispark.istanbul:443 "POST /server/rest/services/Hosted/AnalizLokasyon/FeatureServer/0/347/addAttachment HTTP/11" 200 120
2024-11-25 17:26:49,229 - DEBUG - https://gis.ispark.istanbul:443 "POST /server/rest/services/Hosted/AnalizLokasyon/FeatureServer/uploads/i8f6b82a9-3b82-4b11-8af2-2e72e72d5f1a/delete HTTP/11" 200 None
2024-11-25 17:26:49,245 - DEBUG - https://gis.ispark.istanbul:443 "POST /portal/sharing/rest/content/users/portaladmin/items/c97f16df387f4936a515526ced4e4df2/unprotect HTTP/11" 200 36
2024-11-25 17:26:49,258 - DEBUG - https://gis.ispark.istanbul:443 "POST /portal/sharing/rest/content/items/c97f16df387f4936a515526ced4e4df2 HTTP/11" 200 592
2024-11-25 17:26:49,278 - DEBUG - https://gis.ispark.istanbul:443 "GET /portal/sharing/rest/content/items/c97f16df387f4936a515526ced4e4df2/data?f=json HTTP/11" 200 0
2024-11-25 17:26:54,255 - DEBUG - https://gis.ispark.istanbul:443 "POST /portal/sharing/rest/content/users/portaladmin/items/c97f16df387f4936a515526ced4e4df2/delete HTTP/11" 200 80
2024-11-25 17:26:54,257 - ERROR - Unexpected error.
2024-11-25 17:26:54,257 - DEBUG - Details: ("Failed to create Feature Service Analiz Lokasyon: {'code': 500, 'message': 'Error in deleting Item i8f6b82a9-3b82-4b11-8af2-2e72e72d5f1a', 'details': []}", <Item title:"AnalizLokasyon" type:Feature Layer Collection owner:portaladmin>)
Expected behavior
The cloning process should:
- Successfully transfer the hosted feature layer, including its attachments, from the source portal to the target portal.
- Ensure that all intermediate steps, such as uploading and committing attachments, occur without errors.
- Clean up temporary items without affecting the final item in the target portal.
- Return the cloned item in the target portal without unexpected errors or data loss.
Platform:
- OS: Windows Server 2022
- Python API Version: 2.4.0
- Old Portal Version: 10.8.1
- New Portal Version: 11.3