We’ve been running a few standalone Python scripts using ArcGIS Pro 3.2.0 that execute every 10 to 30 minutes. The process calls a .pyt file, which reads a points dataset and runs the Spatial Analyst IDW tool to create interpolated outputs for rainfall, snow, temperature, and other variables. The output is logged into text files for monitoring purposes.
Typically, everything runs smoothly, and each execution writes a log message indicating success. However, every once in a while—usually once a week or month—the IDW process seems to cause the entire Python process to crash. When this happens, no log message is written, and the crash goes unnoticed unless we manually check the process.
Here’s the typical python workflow:
try:
logger.log_event(messages, "IDW Process Running...")
snowTotIDW = Idw(out_snow_copy, interpolateField, cellSize, power, searchRadius)
logger.log_event(messages, "Completed")
except arcpy.ExecuteError as arcpy_error:
logger.log_event(messages, f"Execute Error:{arcpy_error}\nMessages: {arcpy.GetMessages(2)}")
run_process = False
raise
except Exception as e:
logger.log_event(messages, f"Exception: {e}")
logger.log_event(messages, "ERROR")
raise
The problem is intermittent, but when it happens, it’s a real pain as there’s no direct error message, and no log is produced. This leaves us in the dark about what happened. The only way we can tell is by the time difference in the logfile as shown below where the IDW proces started and then no logs are written out until the process starts again 30mins later:

Is there a better or more robust way to perform this operation using ArcGIS Pro’s tools, or is this just something that can happen once in a blue moon?
Can using atexit help?
I’ve considered using Python’s atexit.register(cleanup) method to register a cleanup function that would catch crashes or unexpected terminations. This could potentially help log any issues and clean up resources, but I’m unsure if it would be sufficient to catch this specific type of crash that happens within the IDW process.
I’d love to hear from others who may have encountered similar issues with ArcGIS Pro 3.2.0 or IDW crashes in general. Any advice or alternative approaches to making this process more reliable would be much appreciated.