QlikView reload task fails error message "System.IO.IOException: The process cannot access the file because it is being used by another process."
The task log will shows a successful reload, but indicates the reloaded document can not be saved.
Information: Reload finished successfully
Information: Start saving document
Error: The sourcedocument failed to save.. Exception=System.IO.IOException: The process cannot access the file because it is being used by another process.
Error: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
Error: at System.IO.File.InternalReplace(String sourceFileName, String destinationFileName, String destinationBackupFileName, Boolean ignoreMetadataErrors)
Error: at QVBWrapper.Document.ReplaceSourceFile(ILogBucket logBucket, String replaceFromFileName, String replaceToFilename)
Error: at QVBWrapper.Document.Save(ILogBucket i_LogBucket, String i_SaveAsFileName)
After successful reload of a QlikView Application (QVW) file, the old file is removed and replaced with a new file containing the new data.
The error message indicates either that the old file could not be removed, or that file access is too slow to process the request.
To identify if file access is too slow due to network latency, or due to disk read/write delays, review QlikView and its backend File Share System
for details on the importance of fast file access, and how to monitor file shares.
In the case of file locks caused by processes locking the original file, the most common processes include:
- Anti-virus software
- Backup software
- QlikView services
The recommendation is to exclude QlikView folders from anti-virus scan. See What QlikView folder/files to exclude for anti-virus scanning
for more details.
Backup of QVW files must be planned and scheduled so that they do not interfere with QlikView tasks, to avoid file access conflicts.
The issue in general can only be resolved by identifying the process that is locking the file. See Process Monitoring - How to find locked files and the processes locking them
for more details on how to identify the process that locks the QVW file.