I'm running a Python script on a local server that functions as a web service. The script receives a text file containing a list of parcel identifiers and uses ArcPy (Python 3.11.11) within ArcGIS Pro 3.5.2 to generate geospatial images for each parcel.
The images are derived from raster datasets (Raster Dataset and Mosaic Dataset) stored in a geospatial database. The workflow includes:
Issue:
The script consistently fails during the SaveToLayerFile step after generating approximately 47 images. The error message is:
ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug and refer to the error help for potential solutions or workarounds.
Failed to execute (SaveToLayerFile).
This generic error doesn’t provide much insight. I’ve tried:
The maximum output achieved is ~47 images (24 parcels × 3 image datasets), which suggests a possible issue with resource accumulation, memory handling, or internal ArcPy limitations.
Environment Details:
Looking for: