ModelBuilder ArcGIS Desktop v.10.6 - Delete and Create a Folder Problem

2502
9
05-24-2018 10:48 AM
BrianLee6
New Contributor II

Hello,

I am running a fairly simple ModelBuilder Iterate model that was previously run on older versions than 10.6.  As I type this message the model is running on v. 10.3.1 just fine. In 10.6, the model runs through the first time and returns a correct result. At the end of the model run, I delete a "process_data" folder and then Make Folder "process_data" folder both with preconditions. When the model goes to run a second time through there is a schema lock error stopping the model. I have given myself full security permissions to the drive I am writing. I write out a geotiff, dbf, and .shp files to the "process_data" directory. In the end, I am looking for a .dbf that I write out to another folder. The "process_data" folder is essentially a scratch space to be used in the process to getting to the .dbf file. 

I have done some searching on the different forums and I am not seeing this type of problem although there are some potentially similar problems and some solutions.

Thank you for any help you can provide.

Brian

0 Kudos
9 Replies
curtvprice
MVP Esteemed Contributor

If there are any file locks on your 'process_data' folder the Delete tool will not successfully delete things, as these in memory objects hold a file lock. Make totally sure any layers or table views which point to your folder are deleted. If my model process is creating a layer or table view explicitly a good approach is to delete it with the last operation in your chain being a precondition (so you don't delete it before you are done with it).

This can be very tricky, as some tools like to create layers and table views behind the scenes. One way you can see if they are there is to crank up the delete tool and see if they are in the input pick list.

0 Kudos
BrianLee6
New Contributor II

Thank you Curtis. I don't view any layers or tables in the ArcMap.  No add to displays. I delete the folder and then create the new folder as preconditions at the end of a run.  It runs fine on 10.3.1 on a Win 7 machine.  It runs fine on a Win 10 machine with 10.4.1.  I have to try it on a Win 10 machine with 10.5.x next.  Of course, I really want to run it on a new 10.6, Win10 machine with the solid state drive so that the model doesn't have to run/iterate for about 2+ weeks on the older machines with regular hard drives.  Thanks

0 Kudos
curtvprice
MVP Esteemed Contributor

It will be interesting if it doesn't work at 10.5 because some architectural changes with raster data processing at 10.5 (and may be a few more things under the hood like that). The other thing to try is running the Model tool from Pro. Sorry I wasn't more help.

0 Kudos
BrianLee6
New Contributor II

Dear Curtis. 

Just tried it on a Win 10 with Arc 10.5.1 from ArcCatalog without the specific process_data directory even connected. I get an Error 000601.   "ERROR 000601: Cannot delete C:\Process_Data\KY_HUC15_Statistics.  May be locked by another application.
Failed to execute (Summary Statistics (2))." right after the first run through.  The model is still running almost a full week now on my Win 7 machine with 10.3.1.  It seem very odd that I would be the first person to run into this problem. I don't think I am doing anything all that exotic in terms of modelbuilder geoprocessing of some raster data.

Thank you for taking the time to think and offer advice.

Brian

0 Kudos
BrianLee6
New Contributor II

I tried it again on that Win 10 machine with 10.5.1 and made sure the Recycle bin on Windows was checked to immediately delete data. Still no luck in getting to run past the first run and then get the error on the second run.  ArcPro might be the way to try next.  Thanks

curtvprice
MVP Esteemed Contributor

Two additional thoughts:

  1. Try writing your summary statistics output to an in_memory table. This isn't only blazingly fast but you may be more successful deleting the table from in_memory than in a real output table.
  2. You've already probably thought of this but poking around in the .gdb folder (sort by date) to look for file locks may give you some clues as to what has been changed and what to do about it. 
BrianLee6
New Contributor II

Downloaded and installed 10.6.1 today and the Background processing. Same fail unlock file issue. Uninstalled 10.6.1, Installed 10.4.1 with Background processing. Works like a champ!!!. Each watershed is processing through in about 30 seconds where it took multiple minutes on my older Win 7 machine.  I did try the 10.6 patch the other day that was available that sounded like it might work, it didn't work either. 

Capture from the 10.6.1 fail.

Maybe I can hope for 10.6.2?

Thanks

Brian

curtvprice
MVP Esteemed Contributor

If you haven't, I suggest logging an issue with Esri tech support so at least they will know about it. If you get a bug #, post it in this thread so others can easily report it if they run into this issue.

0 Kudos
BrianLee6
New Contributor II

Hello,

I ended up getting really busy with some other things in life and this one just stalled out for me. I recently just moved to Pro 2.4 and rebuilt the model from 10.6.1.  Everything seems to be running fine at this point.

Thank you for your interest in replying and helping me.  This past year has gone really quickly.

Brian