Failure to Delete Files From The File Cache Folder During Analysis

Indexes can sometimes fail during analysis, with an error similar to below found in the Analysis log.

'Delete attempt #2: unable to delete file from cache'

The warning indicates that a temporary file created during analysis was not deleted on the first or second attempt. Occasional warnings of this type are expected and should be ignored unless you see several 'attempt #3' or greater logged, or if you see more than 1 warning per 100 files analyzed.

 

The cause of the failure to delete the file is because another process has that file open. We have seen virus scanners and disk indexing software such as the Windows Search Service cause brief file locks. To alleviate this, you can stop such services from interacting with the Discovery Center working folders. 

 

Follow the steps below to determine which process is holding open files in the Discovery Center FileCache folder.

Resolution

The specific resolution will depend on the cause of the file locks.  We recommend using the Microsoft handle.exe which will add extended logging information during the next Analysis attempt. The extended log information will indicate the processes that are preventing files from being deleted.

  1. Download the handle.exe utility from Microsoft
    https://docs.microsoft.com/en-us/sysinternals/downloads/handle
  2. Copy this file to the Analysis sub-folder of the Discovery Center installation folder, by default C:\Program Files (x86)\Discovery Center\Analysis.
  3. Analysis may need to run for several hours until the locking process is caught and logged.

Notes:

The use of handle.exe can itself lead to deadlocks in the Analysis process, be sure to remove the file handle.exe from your Discovery Center installation after you have finished diagnosing the cause. 

Also, sometimes the Discovery Center process 'html_ex_convert.exe' does not release file locks quickly enough for them to be deleted, however, this is harmless and the files will be deleted on the next attempt.