laptop and a wrench

Bug

Updating the item data with the BytesIO object returns the error message "Error 409: Item with file already exists".

ArcGIS API for Python
Bug ID Number BUG-000161855
SubmittedOctober 4, 2023
Last ModifiedJune 5, 2024
Applies toArcGIS API for Python
Version foundN/A
Operating SystemWindows Server
Operating System VersionN/A
StatusNon-Reproducible

Additional Information

This issue is not reproducible.

Workaround

Currently, the fileName is resolved as follows in src/arcgis/gis/__init__.py:14909

           if data is not None and isinstance(data, (io.StringIO, io.BytesIO)):

               if item_properties is None:

                   item_properties =

               if not "type" in item_properties:

                   item_properties["type"] = self.type

               if not "fileName" in item_properties:

                   fileName = self.name

                   item_properties["fileName"] = fileName

Consider using a random filename, or appending a timestamp to the end of the itemId as a filename.

           if data is not None and isinstance(data, (io.StringIO, io.BytesIO)):

               if item_properties is None:

                   item_properties =

               if not "type" in item_properties:

                   item_properties["type"] = self.type

               if not "fileName" in item_properties:

                   fileName = f"self.name_str(round((datetime.now()).timestamp()))"

                   item_properties["fileName"] = fileName

Steps to Reproduce

Bug ID: BUG-000161855

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