Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We've several Windows Server 2003 machines running, each with its own purposes. There are scheduled jobs which synchronizes some files over SFTP using WinSCP. Very sometimes a newly copied file is left locked in the "inbox" folder without any reason. The machine's own background task (programmed in Java) can't move it to the "processed" folder anymore after processing it.

Manually moving it only yields the well known error message Cannot move [filename]: it is being used by another person or program.

I tried Unlocker which works fine locally at WinXP, but doesn't work at those Win2K3 machines by remote desktop (unlock option doesn't show up in rightclick context menu). I tried Process Explorer as well as described in this blog article, but it caused the server to crash and reboot (not sure if that's because it's executed through remote desktop).

The only resort is to reboot the machine, but we would of course like to avoid that. Any suggestions?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

What happens if you restart the FileZilla Server service? You could exec net start/stop "FileZilla Server" service from your Java application if it fails to move the file.

share|improve this answer
    
Good suggestion. Unfortunately we don't have any locked files anymore to test it :) I'll keep this in mind for the case it occurs again, thank you! –  BalusC Apr 15 '10 at 15:06
    
"Finally" a file was locked last friday so we could test it and it was indeed the cause. Thanks! –  BalusC Jun 14 '10 at 13:51
add comment

If the file was being held open by the kernel (System process) then killing the handle generally results in a blue screen, although not always.

Typically closing the program that had it open will free up the lock. I'd suspect your Java application is at fault ultimately.

These resources may be useful:

Configuring opportunistic locking in Windows http://support.microsoft.com/kb/296264

How Oplocks function in the Windows Environment http://msdn.microsoft.com/en-us/library/cc308441(v=MSDN.10).aspx

share|improve this answer
    
It's either WinSCP or the SFTP server (Filezilla) which has locked the file. The Java application is just the one which cannot move it because it's locked. It works fine for all other files. This occurs about once in two weeks or so (on average, 5 files are processed this way daily). Thank you for the links, the last link however fails to open properly. Can you please update the link? –  BalusC Apr 15 '10 at 13:42
    
Yes, I'd agree with you after rethinking it. Is FileZilla up to date? Does the user it runs as have appropriate permissions on the folder? –  sinping Apr 15 '10 at 14:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.