AnsweredAssumed Answered

Schema lock error from script tool before script executes.

Question asked by blbrock on Oct 30, 2012
Latest reply on Oct 31, 2012 by blbrock
I've run into yet another annoying schema lock problem. I have a python script run from a toolbox script tool that creates a stand alone table as output. It works fine except the tool will not overwrite outputs despite having the overwrite geoprocessing outputs option checked. The script throws 'ERROR 000601: Cannot delete C:\WorkSpace\table.dbf. May be locked by another application.' However, there is no schema lock since the file can be easily deleted from ArcCatalog or the os. Also, when you set the output of the tool to an existing file, you get the usual warning about overwriting the output and the yellow warning triangle appears next to the parameter.

I've tried the usual workarounds like setting the arcpy.env.overwriteOutput = 1, checking for the existence of the file and deleting from within the script, etc. But what I have discovered is the error is occuring before any of the script is executed. So it is a problem with the tool validation. I found a couple threads in the archive that seem to deal with this same problem:

http://forums.esri.com/thread.asp?c=93&f=1729&t=269523

http://forums.esri.com/thread.asp?c=93&f=1729&t=300027

I tried the work around and a few variants in the second thread but haven't found anything that works. Any ideas?

Brent Brock, Landscape Ecologist
Craighead Institute

Outcomes