laptop and a wrench

Bug

Cloning Portal for ArcGIS items using ArcGIS API for Python returns the error message, "The process cannot access the file because it is being used by another process: 'C:\\Users\\ssa_arcgis-maps\\AppData\\Local\\Temp\\metadata.xml" when search_existing_items=False.

ArcGIS API for Python
Bug ID Number BUG-000161049
SubmittedAugust 30, 2023
Last ModifiedSeptember 23, 2025
Applies toArcGIS API for Python
Version foundN/A
Operating SystemN/A
Operating System VersionN/A
StatusNon-Reproducible

Additional Information

This issue is not reproducible when using the script tool in ArcGIS Pro 3.2.2 and ArcGIS API for Python 2.2.0.1 to clone in ArcGIS Enterprise 11.2.

Workaround

  • Remove search_existing_items=False from the script.
  • Edit the script to execute the clone_items() function once for every item in the items list. For example:

For the item in user.items(folder=sourcefolder):

   item = gis.content.get(item.id)

   gis.content.clone_items([item], folder=targetfolder, search_existing_items=False)

Steps to Reproduce

Bug ID: BUG-000161049

Software:

  • ArcGIS API for Python

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options