I have a model I've been using regularly for quite some time. It seems rather random that I get a schema lock error when it's running...until today when I ran it 10x to no avail. Simply, the model takes a shapefile, edits it, copies to a file geodatabase as a copy, then a python script stops my AGS, deletes the former feature class, renames the copy, repeats the copy/rename for a duplicate file geodatabase that is not used by AGS, then restarts AGS via a python script.
This had all worked in the past. I did have some issues with the script not stopping the server service and causing a schema lock on the geodatabase on the server but that was taken care of. I'm now getting the schema lock on the duplicate that is on another machine entirely. Everything works up until it should delete the existing feature class, and that's when i get the schema lock error.
I tried:
running the model in ArcMap, while no data is loaded
restarting ArcMap to ensure no lock
Closing ArcMap and using ArcCatalog instead
restarted my machine
I assure you that there is no one accessing the data, including me, other than this model. I've scoured the internet and it seems everyone's answer is that someone else is editing it. Not possible.
I have also opened the gdb in windows explorer and watched for the lock file. It isn't there when I begin the model and it appears that one is created at some point during the model itself and then it doesn't release it and it won't allow me to delete the file.
I am able to access/edit/delete these same files afterwards by hand using ArcCatalog despite that lock file still being in the gdb. Apparently it's just the model that can't.
What I don't understand is that the lock should be there to prevent other users from editing the data at the same time, but I am the only user. Is it maybe acting like the model is a different person somehow?
Another thing of note is that we did just replace the server where this file exists. (server 2013) I checked the permissions on the folder location and the gdb itself and domain users (me included) have full rights.
It's been quite a frustrating day dealing with this as the model is quite important and takes a good 30 minutes to run so it's slow going in the troubleshooting. Any ideas?