Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Conflict over files being used by other scripts

Hi,

I am a pretty new administrator/developer on QlikView.

Lately I've been getting notifications that a script is failing.

The document log says:

Error: The process cannot access the file because it is being used by another process.

The task log says:

Error: The source document was NOT reloaded successfully.

The file referenced in the document log is various TaskExecutionHistory files (almost different one for each fail). So it seems my failing script has some conflict over these files that is being written to from other scripts.

My questions are:

1. Is this somewhat "expected" to happen when one has many applications and tasks running?

2. Would it be possible to modify the script (the failing one) to read the files in question although it is being used by another process?

3. Possible to modify the script to not fail if the file is in use? But instead continue? If possible, is it a bad idea?

I appreciate all your input.

9 Replies
Chris_Rice
Support
Support

I'm a bit confused as to what's happening here.  Are you attempting to load the TaskExecutionHistory files into a QVW or QVD, or are you getting that error on a write function?  I ask because I'm pretty sure QV writes to that file after a reload, and if that's when you're seeing the error it's probably a bug.  If this is the case, what is the size of that file at the time of the error (I'm thinking 0KB).

If, on the other hand, you're getting this error during a read of that file it could very well be cause by conflicts from other load scripts.  In general, QV will lock a file that it's reading from in order to prevent any edits during the read process.  So, if another script is trying to read from the same file at the same time you're bound to get errors.

Bill_Britt
Former Employee
Former Employee

Hi,

If you are trying to read and write to QVS's at the same time this will happen. Also, if you are running antivirus that does real time scan this will also lock the files.

Bill

Bill - Principal Technical Support Engineer at Qlik
To help users find verified answers, please don't forget to use the "Accept as Solution" button on any posts that helped you resolve your problem or question.
Not applicable
Author

Hi Chris,

thanks for your reply and apologies for my unclear explanation of the problem.

Are you attempting to load the TaskExecutionHistory files into a QVW or QVD, or are you getting that error on a write function? 

Yes, I am loading the TaskExecutionHistory files into a QVW. So once in a while I get an error with the message that "it is being used by another process".

I checked the Task ID, and there are various other applications that seems to "use" the TaskExecutionHistory files when I do get the error. So I'm wondering if I am just unlucky at times and that two scripts are trying to access the same file (taskExecutionHistory) at the same time?

Chris Rice wrote:

If, on the other hand, you're getting this error during a read of that file it could very well be cause by conflicts from other load scripts.  In general, QV will lock a file that it's reading from in order to prevent any edits during the read process.  So, if another script is trying to read from the same file at the same time you're bound to get errors.

Yes I think this is what I'm getting at, if this is what could be happening. If I understand the TaskExecutionHistory files, they are being written to every time a task on the publisher runs? If so, I suppose there is a great chance that I'll be having a conflict over these files if I in addition have a script that loads these files into a QVW?

Not applicable
Author

Thanks Bill, I will check if we are running Antivirus.

Chris_Rice
Support
Support

Yes, that's correct.  Be sure to check the Anti-Virus as well like Bill said as that has been known to also cause problems.

ashfaq_haseeb
Champion III
Champion III

Hi

I Still say try to split task and schedule dependent task i.e one after another in order to avoid file locking by Qlik.

Regards

ASHFAQ

Not applicable
Author

Appreciate your input. I need to look further into if this can be a solution, but it is difficult to do this due to the amount of tasks running on the server. We also already have large amounts of dependent tasks, so restructuring them all would increase the complexity of the already nested tasks. In addition, it would also cause a large number of applications to not update if/when another task fails, which would not be a good solution in regards to having updated data.

Not applicable
Author

There is a antivirus program but it does not scan the folder in question.

Not applicable
Author

Hi Chris,

Could you please clarify what you are referring to as "correct"?

And do you know if there is a workaround this issue? (script reload fails because file is being used by another process)

     - Ref my questions 2 and 3 in the original post?

Best regards