Errors writing rasters when iterating

Discussion created by matthewb on May 22, 2013
Latest reply on May 22, 2013 by matthewb

I am using a cursor to iterate a polygon feature class, extract rasters derived from a DEM, reclassify them and perform a weighted sum. I have tried various methods/syntax and they all seem to work for a while and eventually fail when writing out a new raster. It fails at different places in the script on different rows of the cursor and seems to be related more to locks on the FGDB I am writing to. (If I execute the Python that fails in the same process to a different location it works perfectly.) I have set arcpy.env.overwriteOutput = True but get the same result even if the output raster doesn't already exist.

Here's a typical error:

ERROR 999999: Error executing function.
Workspace or data source is read only.
Workspace or data source is read only.
No spatial reference exists.
ERROR 010029: Unable to create the raster C:\Users\matthewb\Documents\ArcGIS\default.gdb\SliceDEM59.
ERROR 010235: Returned error from SLICE.
ERROR 010067: Error in executing grid expression.
Failed to execute (Slice).

Often after this error there is a File Geodatabase Table with the raster output name, although the properties dialogue says it is a polygon feature class. From the field names, it appears to be the raster footprint. This table cannot be deleted until ArcGIS Desktop is restarted.

Is there something I can do to programmatically to ensure there are no locks? Are FGDB rasters the best format to be using? Is ArcGIS Desktop 10.1 as riddled with bugs as I think it is??? (I'm running ArcGIS Desktop (ArcEditor) 10.1 SP1 on Win7 x64 SP1.)