9 Replies Latest reply: Aug 5, 2014 8:25 AM by Pete Skje RSS

    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.

        • Re: Conflict over files being used by other scripts
          Chris Rice

          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.

            • Re: Conflict over files being used by other scripts

              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?

            • Re: Conflict over files being used by other scripts
              Bill Britt

              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