I am experiencing this issue intermittently. I have a Qlik Sense client that is still using their old QlikView extractor to generate their QVDs. The QlikView is just the FREE version of the QlikView desktop app (therefore no services or shared files). For test purposes I have even tried to license the QlikView desktop but the issue still remains. It is QlikView April 2020 therefore Version 12.50
Basically they run a batch file to open the QlikView model which extracts the data and stores into the QVDs. This batch file is no longer working. You can actually run it but then the error message pops up and you have to say "OK" and then it carries on and generates the qvds however the error pops up later again to save after it has finished reloading. Obviously, this is not ideal since we need the extractor to run during the evening when no one is around to monitor it.
This stopped working about a month ago. I can open the old extractor and copy the script and save it as a new QVW. It will then run fine but the moment I want to save the NEW QVW it gives the error message "ENCOUNTERED A SHARING VIOLATION WHILE ACCESSING C:\QlikView\ModelName.QVW" even though I just re0created the QVW myself with a new name.
I have tried adding the following command line into the batch file:
taskkill /im qv.exe /F (https://community.qlik.com/t5/QlikView-App-Dev/Encountered-a-sharing-violation-while-accessing-the-q...)
I have checked the following: Computer Management - Shared Folders - Open Files and did not find any open files plus as mentioned previously it is QlikView Desktop and therefore no shared files (https://community.qlik.com/t5/QlikView-App-Dev/Encountered-a-sharing-violation-while-accessing-a-QV-...)
I have logged off their server and back on so no sessions should be open.
Please advise what else I should be looking for?
Ideally we are moving away from this solution and will be using API calls to pull directly into Qlik Sense but that process has not yet been finalized.
Any suggestions, help or guidance will be appreciated.
Thanks in advance!
AFAIK this error indicates that any other process has locked this file respectively QlikView didn't get the appropriate rights to access/write/change the file. The first may happens from any parallel access of any user but also from services like the windows shadow copies, index-service or any security tool. The last is usually rather a temporary cause if the I/O communication with the OS failed or uns into any timeout if the execution is queued.
Another cause could be any corruption within the NTFS file-system which controlled all meta-data to a file and therefore also the access-rights. Quite recently we had a very strange case with an Excel-file which couldn't be opened (not even with an editor like Notepad++) with any tool and it couldn't be deleted either - it looked that it would work but after a short moment the file were back. After a few days a renaming was successfully and then we could delete it. I think it was a ghost - not a real existing file else just the entry within the content were there respectively it were a lookup (hardlink/softlink) to another address or similar and anything went wrong. Maybe there was re-start of the network-storage or any repair-mechanism (in general there are ones) but I couldn't say in the end what happens and why.
To make it short with a suggestion: try to restart all systems.
Thanks for the reply Marcus. What is really strange is that I can create a new model - from scratch - the save it and while the model is still open, successfully run it and then when trying to save it again immediately afterwards I get the sharing violation error.
Like you say, perhaps it is not Qlik related at all.
Yes, I think that's quite unlikely that QlikView caused the issue and that there is rather a conflict with the Storage/OS in regard to the control-mechanism of the I/O. Whereby AFAIK is such a case very rarely. I assume that your system and storage are now re-started and also that any possible access-topics from a security tool or group policy rules were checked without any reasonable hint.
If the issue now further exists I would remove the Qlik Sense access on this file + folder and also re-starting Sense - maybe the Sense call of the file isn't completely finished. Means something like Sense opened/read/closed the file but didn't communicate it properly against the storage that it has finished the task ...
Hi Marcus and others reading this post,
There were two changes that we needed to make. Although we had been re-granted our administrator rights, by default the permissions on the folder had revoked form Full access to read only. We needed this to be changed to full access because the Qlikview.qvw could not be saved.
Then we looked for the last successful run via the windows task scheduler and took not of the time. Turns out there were a few runs that were running from the schedule but returning errors and not stopping or cancelling the job. We were able to remove this error by using the task manager to determine which tasks were still running and cancel them out. We then restarted the run and it saved successfully into the correct folder. This is all theory at this stage (working perfectly when manually reloaded) and will update you tomorrow after an automated scheduled reload works successfully. <Fingers crossed>
Just an update. The Tasks are successfully kicking off now and running to completing however the Windows Scheduled task says it is still running (although the QVDs are created within 5 minutes) so it terminates the Windows Task Scheduled job after an hour - as per the properties set up on the scheduled job.