Random Files locked for editing

We have several servers in a VMWare environment that have file shares that are deployed via mapped drives to a terminal server with about 40-50 users on it. The server os used on all is Server 2008 R2 with all latest patches.

A few months ago the servers locked up and had to be rebooted due to issues with one of our SANs. Since that has happened random files have been giving users an error message when they attempt to open them. It actually lets them open the files after a second attempt which is clearly showing something is glitched out.

"xxx.docx is locked for editing by 'another user' "

Sometimes it would actually say the users name, one time it even said the name of a user that didn't even work there anymore.

I ended up resetting ownership of all 250GB worth of files to the administrator account, and gave Domain Users read/write and modify permissions. I essentially stripped ANY custom permissions and made the files appear to Windows as if they had always belonged to the admin and reset all permissions to a blank slate and this is still happening. Any ideas? I'm posting a picture of the file below as well. Any help would be appreciated and if more info is needed please ask. Thanks!
Locked-for-Editing.JPG
Jryals8900Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robin CMSenior Security and Infrastructure EngineerCommented:
If the files are held on Windows File Server you can go into computer management on the file server and look at System Tools, Shared Folders, Open Files which will tell you the files that are open and who has them open. You can see which workstations files have been opened from in Sessions.
If you have Excel 2010 or 2007 there is (was) a known problem where the wrong name might be displayed as the person locking the file.
Loads of stuff for you to check through in this article: http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2012/05/14/the-definitive-locked-file-post.aspx
and even more stuff in the comments.
btanExec ConsultantCommented:
Maybe useful insight as shared by user in forum on similar experience
So if you receive the "Unable to access a file since it is locked" when powering on a VM, or receive an error about can't find the file when trying to deploy a new VM from a template, check ALL your VM's vmx files to make sure that one of them is not actually using that template/VMs VMDK file.
https://communities.vmware.com/thread/152969

 also I am thinking the locking may be due to backup process as well
Note: Locked files can also be caused by backup programs keeping a lock on the file while backing up the virtual machine. If there are any issues with the backup, it may result in the lock not being removed correctly. In some cases, you may need to disable your backup application or reboot the backup server to clear the hung backup.

This lock can be maintained by the Service Console for any hosts connected to the same storage.

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051
Jryals8900Author Commented:
Thanks Robincm:
The error message as far as I'm aware is completely separate from VMWare. It is not associated with powering the VM. All VM's could have been on for weeks and the error message is displayed at random times throughout the day.

That link you provided in the second paragraph does seem helpful however the link going to Server 2008 R2 is an update rollup so it's likely it was already installed. I will go through the update history and varify. Edit: I may be mistaken on this I think I clicked the link for Itanium and not 2008 R2 x64. Will review.


Thanks BTan:
The error message you show is different, that's a VMWare error message for deploying templates. The error message we're getting is associated with a Windows locked error message.

I have checked the backups but they are running from within the VM, not outside. There don't appear to be any errorsin the backup logs either. Backups were not occuring during the lockup and force reboot so that shouldn't be it but I can check with another tech here to see.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

btanExec ConsultantCommented:
Thanks for the clarification. The MS kb stated for this error
This behavior may occur if Word determines that the owner file for the document already exists. This may occur if one or more of the following conditions are true:
Word previously quit improperly and, therefore, did not delete the owner file.
-or-
A second instance of Word is running in the background with the document already open.
-or-
The document is shared over a network, and another user has it open.
In short, Word creates an owner file when you open a previously saved Word document. An owner file is temporary and holds the logon name of the person who opens the document.

https://support.microsoft.com/en-us/kb/313472

In most case I experienced, it has to do with mapped drive storing and accessing the document by all assuming the legit users are granted access to that folder. Seldom we see this "lock' if we used notepad or wordpad to open instead of Word office. Of course, the concurrency checks is critical to ensure no race condition tampering the document integrity.

In specific, the locked files are mostly due to Temp Directory use by MS Office. Word places this copy in the Windows Temp directory every time the document is opened and accessed. So when you open a file that stated it is locked, it is either because it is already open
a) in another window of Word; or
b) by another user on the network; or
c) its document template attached to a document is likewise already in locked stated (e.g. Word automatically makes a copy of the template in the Temp directory too).

As a whole, the copy of a locked file does not automatically update the original owner's file till the document is fully closed. This may be the crux of issue as scheduler or backup service or indexer service (Windows Indexing service) or user that open/access it w/o proper closing the document, the temp copy will also be existence and locked case will persist and happened.


What other checks to help alleviate and find root cause (just some thoughts below)  ----

1) Go to Computer Management -> System Tools -> Shared Folders -> Open Files to find out who has a document locked. If the user can't be contacted to disconnect themselves, you can forcefully do so by right clicking the locked file and selecting Close Open File (warning: the user might lose their changes).

2) Doing some diligence checks to ensure
a) no one is opening it and enforce more stricter ACL on the folder,
b) use shorter filename and not too deep of subfolder depth (saw some forum stated saving error)
c) clean up temp folder and monitor with simple tool like OpenedFilesView and LastActivityView to check multiple run by specific process and user, and various application access the files
http://www.nirsoft.net/utils/opened_files_view.html
http://www.nirsoft.net/utils/computer_activity_view.html
d) consider using tool to unlock e.g unlocker - a program which unlocks locked files or folders. (OpenCandy adware, just uncheck it while installing or use the portable version.)
http://emptyloop.com/unlocker/

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jryals8900Author Commented:
This issue occured after a server crash. There is no one opening the files at the time of the messages in fact several times it has shown as locked by users that didn't work at the company anymore. Also the fact that it is saying it to users and then allowing them to open afterwards points to some sort of glitch.

I have also opened a Microsoft ticket but all they did was recommend the hotfixes that robincm posted so I will try that first. I will also try the open files program  by Btan and see if it can see the Owner temp files associated with these "open" word documents.
Robin CMSenior Security and Infrastructure EngineerCommented:
Let us know how you get on! Hopefully the hotfixes will do it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Server OS

From novice to tech pro — start learning today.