Select to view content in your preferred language

clone_items() fails with timeout error

357
1
01-15-2025 10:44 PM
Labels (2)
DanaAbumourhMAG
Emerging Contributor

Hello!

I have an ArcGIS Online Hosted Feature Layer, its size is 255 MB, it has attachments with size: 12.53 GB. It's failing to clone (clone_items) due to time out after about 15-20 minutes.

Smaller Feature Layers clone without issues.

Is there a limit to the size of the items we can clone? If there is, is there a way to work around this?

Sample script:

from arcgis.gis import GIS

gis = GIS("https://arcgis.com", "username", "password", expiration=9999)
layer = gis.content.get("featureserviceid")
gis.content.clone_items([layer], "Test Folder")

 

This is the error I'm getting:

Your request has timed out. : (Error Code: 504)', <Item title:"item_title" type:Feature Layer Collection owner:username>)
File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\arcgis\_impl\common\_clone.py", line 4270, in clone
raise _ItemCreateException(
arcgis._impl.common._clone._ItemCreateException: ('Failed to create Feature Service service_name: Your request has timed out. (Error Code: 504)', <Item title:"item_title" type:Feature Layer Collection owner:username>)

0 Kudos
1 Reply
David_McRitchie
Esri Regular Contributor

Hey Dana,

I took a look and saw that a bug (BUG-000120207) had been logged a while ago for this that unfortunately had to be closed as this is a known limit with the ArcGIS API for Python.

As a workaround I suspect that an empty layer with matching schema would need to be created, and then data appended in chunks to try get around the time outs.

Hope that helps,

David

Esri UK -Technical Support Analyst
0 Kudos