Probe Software Users Forum

Software => Probe for EPMA => Topic started by: theguylafayette on January 22, 2014, 12:20:51 PM

Title: Could not lock file
Post by: theguylafayette on January 22, 2014, 12:20:51 PM
I have successfully been using Probe for EPMA on my personal computer (non-network) for almost a year. This week for some reason I have started to get a recurring error message as soon as I attempt to work with any file using the program. As soon as I attempt to work with a file (via Analyze! for example) I get an immediate error message of DataGetMDBSample "Could not lock file". I have attempted using backup versions of the files and received the same error message. I have also tried uninstalling and reinstalling the software with the same resulting error message. All of the typical fix-it forums reference this error only occurring in networked systems, which does not apply in my case so I have been unable to find a fix using general computer forums. Has anyone ever received this error message using Probe For EPMA and do you have any suggestions on how I might tackle this issue? I would really appreciate any advice you could give me. Thanks for your help.
Title: Re: Could not lock file
Post by: Probeman on January 22, 2014, 01:28:43 PM
Hi "guy",
This is a rare error but I've seen it on XP systems when running PFE under a "limited" account.

Can you tell us what OS you are using and also which version of PFE you installed?  Did you try installing both the CalcZAF.msi and ProbeForEPMA.msi installers?  You need both.

If you are using Windows XP, then this document might help. See attached.
Title: Re: Could not lock file
Post by: Jeremy Wykes on January 23, 2014, 02:22:24 PM
I get this error all the time running Probe for EPMA under Windows 8. I had assumed it was because my mdb files were stored in my Dropbox folder, which is always being checked by the Dropbox algorithm to see if files need to be synchronised.
Title: Re: Could not lock file
Post by: Probeman on January 23, 2014, 04:57:03 PM
I've never seen this error under Windows 7.  You might try running the latest CalcZAF.msi and Probe for EPMA.msi installation files as we did tweak the permissions on these installers since you acquired your data here.

https://www.probesoftware.com/resources/

Please let me know if that helps.  I can't speak to accessing the files from Dropbox.  I guess try them on your hard drive as a test.
Title: Re: Could not lock file
Post by: theguylafayette on January 24, 2014, 10:55:02 AM
I'm running the programs on Windows 7. I have both programs (CalcZAF and Probe for EPMA) and have been running them successfully for close to a year on this system. This is an issue that only popped up in the last few days. I just downloaded the updates to 10.2.3 (originally was using a 10.1 version) and I still get the error with the updated program.

I also attempted the Windows XP file sharing fix. I still received the same error, but I am not fully convinced that I changed the sharing properties correctly.
Title: Re: Could not lock file
Post by: John Donovan on January 24, 2014, 11:06:08 AM
The XP fix won't work under Win7, I was just guessing your OS because at first you didn't state what OS you are using.

Did you try opening some data files *not* in your DropBox?
john
Title: Re: Could not lock file
Post by: theguylafayette on January 28, 2014, 12:00:23 PM
John,

I have attempted the following fixes:

Uninstall/reinstall
Changing sharing permissions on UserData and Probe for EPMA folders.
Using backup files saved on DropBox
Using backup files from external harddrives

Andrew
Title: Re: Could not lock file
Post by: John Donovan on January 28, 2014, 12:15:07 PM
Probe for EPMA is designed to handle data files stored almost anywhere that has both read and write permissions.

Is there some reason you haven't tried reading the data files from your hard drive?  That is, that UserData folder on your C:\ drive?
john
Title: Re: Could not lock file
Post by: theguylafayette on January 29, 2014, 04:01:25 PM
John,

I'll try to be a little clearer about what has happened and what I have tried. Let's start with an example file like August.mdb. August was created during a run in August 2013. After this run I saved this file directly from the EPMA instrument computer onto my hard drive. At this same time I saved a copy on dropbox and also saved a copy on an external hard drive. Since August I have successfully modified August.mdb using Probe for EPMA multiple times on my computer. Using the same routine for opening the files that I have always used successfully, last week I began receiving the error message "Could Not Lock File". Any attempt to use any function in Analyze! immediately led to this error message. The files on my hard drive in the Userdata folder no longer worked and only produced this error message.

This is what led to my attempts at the various fix-its I listed previously, which included downloading the backup files from dropbox and copying over the original files from my external hard drive to see if it was the data files that had become corrupted or if it was a program/system issue. As both the original versions from dropbox and the external hard drive do not work either, I think there must either be a program or system issue. At the moment I'm stumped at what to try next. I appreciate any tips/advice/suggestions you might have. Thanks for your help.

Andrew
Title: Re: Could not lock file
Post by: John Donovan on January 29, 2014, 07:31:03 PM
Quote from: theguylafayette on January 29, 2014, 04:01:25 PM
...Using the same routine for opening the files that I have always used successfully, last week I began receiving the error message "Could Not Lock File". Any attempt to use any function in Analyze! immediately led to this error message. The files on my hard drive in the Userdata folder no longer worked and only produced this error message
Hi Andrew,
Thanks for providing some context.   Well, I must say, this is certainly a conundrum... the closest to this that I've seen is years ago in NT4, when I would update Microsoft Office software and sometimes it would break the DAO (Data Access Object) I use for storing data in the database files. I would then re-install Visual Basic and it would be ok again.

The only reason I mention this is to ask if you can remember last week if you updated anything or installed something, or even uninstalled something.  This might be an excellent clue. 

Some questions:

Are you logged in as an "administrator" when running these tests?

Have you tried running both the CalcZAF and ProbeForEPMA msi installers? 

Do all (old and new) PFE MDB database files show the same symptoms?  Is it only PFE MDB files that are complaining about not locking?

Can you open the standard database (Standard.exe) and add a "test" standard? Say PuO2?

What happens if you create a new file in "demo" mode (click "yes" to the first question) and make some new samples, acquire data, etc.?

Have you tried opening the same MDB files on another computer with PFE?

Finally, have you tried editing the file properties by right clicking on the MDB file?

It would be great if you could respond to these questions one at a time when you have a chance.
john
Title: Re: Could not lock file
Post by: Jeremy Wykes on January 29, 2014, 10:27:13 PM
I can confirm that when I open files not located in Dropbox, I do not get the "Could not lock file" error.

I ran Sysinternals Procmon to see what was happening when that error appeared, and if I understand what it found, then it looks like you generate that error when attempting to delete the (I assume temporary) .ldb file.

That may explain the dropbox behaviour, as it is trying to index/sync a short-lived .ldb file. If this is the case then other indexers, or virus scanners may produce the same result.

This is an example of the event I always see associated with a "Could not lock file" error:

5:23:43.8654640 PM   Probewin.exe   4844   CreateFile   C:\Users\jeremy\Dropbox\Wykes_WDS\03-13-2013\s_in_hydrous_andesites.ldb   DELETE PENDING   Desired Access: Generic Read/Write, Disposition: OpenIf, Options: Synchronous IO Non-Alert, Non-Directory File, Random Access, Open No Recall, Attributes: N, ShareMode: Read, Write, AllocationSize: 0
Title: Re: Could not lock file
Post by: John Donovan on January 30, 2014, 09:27:13 AM
Hi Jeremy,
Awesome detective work. Thank-you!
john

Andrew,
Ok, I moved an MDB file to my drop box and sure enough, if I browse to the MDB file and open it, it opens. But when it tries to perform an analysis it fails with what you and Jeremy are reporting:

(https://smf.probesoftware.com/oldpics/i60.tinypic.com/incumu.jpg)

So, not surprisingly, my suggestion is: "don't do that!".    ;D

Apparently Dropbox is not designed to support fast DAO I/O with file locking!

Now, if you are having an issue opening a Probe for EPMA file from your C:\ or D:\ or whatever drive or even any normal network drive (several of our customers keep all their MDB files on a network file server with no issues), please let us know the specific details.
Title: Re: Could not lock file
Post by: Gseward on January 31, 2014, 09:48:19 AM
John, Jeremy,

Very interesting! I had problems with the same error for about 2 years on my PC connected to the probe with an XP installation. More often than not the problem appeared when I was analysing a sample with a lot of  analysis points in it, or when calculating the run time for a large list of standards/unknowns. I noticed that if I closed all unnecessary applications and only had PFE running, the problem would go away (hence I was able to live with it for two years). This led me to believe it was processor-loading related. When I upgraded to a more powerful PC then problem went away. Hence, I thought I knew the answer, but perhaps I didn't; based on your observations, perhaps I was barking up the wrong tree.

gareth
Title: Re: Could not lock file
Post by: John Donovan on March 02, 2014, 12:37:55 PM
Quote from: Gseward on January 31, 2014, 09:48:19 AM
Very interesting! I had problems with the same error for about 2 years on my PC connected to the probe with an XP installation. More often than not the problem appeared when I was analysing a sample with a lot of  analysis points in it, or when calculating the run time for a large list of standards/unknowns. I noticed that if I closed all unnecessary applications and only had PFE running, the problem would go away (hence I was able to live with it for two years). This led me to believe it was processor-loading related. When I upgraded to a more powerful PC then problem went away. Hence, I thought I knew the answer, but perhaps I didn't; based on your observations, perhaps I was barking up the wrong tree.
Maybe not...  if the OS does the file locking fast enough in the Dropbox folder it might be ok.

But, yes, probably better not to try to access PFE MDB files from inside your Dropbox. Even if it works fine, it will most probably be much slower.
Title: Re: Could not lock file
Post by: EricKelly on February 20, 2015, 09:30:19 AM
The "Could not lock file" error is happening to us now too.  Two probe runs have failed now, so this is a big concern.

We just upgraded our probe computer to a new PC running Windows 7.  The old computer was slow but did not have this error.

On the new probe computer, the problem occurred with a previous version of PFE, so I updated to the latest version (10.7.2) but the error is still there.  We do not use Dropbox on the lab computer.  I asked for help from my IT guy, and we disabled an encryption program (BitLocker) that normally encrypts the entire hard drive.  We also set PFE to run as administrator.

Also, my office computer (Windows 7) shows the error sometimes, but if I retry a few times, it seems to get through the task. I do not keep PFE files in Dropbox on my office computer.  It is also running BitLocker (enabled).

If other labs are not experiencing the problem, perhaps it's specific to our computers, which are typically imaged with the same OS and programs.  Having disabled BitLocker, it seems that the conflict is somewhere else.

Any ideas?  Thanks,

Eric
Title: Re: Could not lock file
Post by: John Donovan on February 20, 2015, 10:05:54 AM
Quote from: EricKelly on February 20, 2015, 09:30:19 AM
If other labs are not experiencing the problem, perhaps it's specific to our computers, which are typically imaged with the same OS and programs.  Having disabled BitLocker, it seems that the conflict is somewhere else.

Hi Eric,
The only reports I have had are posted above.  I myself have never seen this error on a Win 7 computer.

If I were you I would just uninstall BitLocker. These 3rd party low level apps are just asking for trouble.

I had one user that had 5 (count'em, 5!) firewall apps installed and was complaining about some network problem...
john

PS This is what I found on the MS developer site:

QuoteCould not lock file. (Error 3050)

The operating system will not allow the Microsoft Access database engine to create a lock file (.LDB) in the same directory where the database file resides. You need to have write privileges to the directory that contains the database you are trying to open. This error can also occur if you are trying to use the passive shut down/connection control feature while the database is opened exclusively.

I'm not "trying to use the passive shut down/connection control feature" and not only that, the database is always opened non-exclusively in DataGetMDBSample.

Eric: can you send me the complete error message? Just a screen shot will do.
Title: Re: Could not lock file
Post by: John Donovan on February 21, 2015, 05:40:31 PM
Hi Eric,
I modified the DataGetMDBSample open database code to add a robust retry even though it is read only. This will be in v. 10.7.4 of PFE.

Download and see if that helps your situation.
Title: Re: Could not lock file
Post by: EricKelly on February 22, 2015, 09:55:19 AM
Thanks, John.  I think the error message is the same as what was posted previously: "Could not lock file".  Although I did not notice the title of the window (DataGetMDBSample).  If we get another, I will capture it for you.

Our IT support helped again too.  We cannot uninstall BitLocker as it is part of the enterprise Windows 7 that the university uses.  It is disabled though.  We also set the computer to decrypt the drive overnight.  This should not matter because once the encryption is disabled, new files should not be encrypted, and even though we tried making new PFE data files, the error still occurred.  Our PFE user directory was already accessible by all users but he made sure that all accounts on the machine had modify privileges just in case.

I also noticed that the error occurred more frequently as the session went on.  I am doing an analysis with a dozen elements, so I wonder if the amount of information in the file/memory is creating more opportunity for the error to occur.

Thanks for the new PFE version.  Let's hope that does the trick!
Title: Re: Could not lock file
Post by: John Donovan on February 22, 2015, 10:40:36 AM
Quote from: EricKelly on February 22, 2015, 09:55:19 AM
Thanks, John.  I think the error message is the same as what was posted previously: "Could not lock file".  Although I did not notice the title of the window (DataGetMDBSample).  If we get another, I will capture it for you.

Hi Eric,
It helps to have information.

Quote from: EricKelly on February 22, 2015, 09:55:19 AM
Our IT support helped again too.  We cannot uninstall BitLocker as it is part of the enterprise Windows 7 that the university uses.  It is disabled though.  We also set the computer to decrypt the drive overnight.  This should not matter because once the encryption is disabled, new files should not be encrypted, and even though we tried making new PFE data files, the error still occurred.  Our PFE user directory was already accessible by all users but he made sure that all accounts on the machine had modify privileges just in case.

Let this be a lesson to you!    ;)

Never use a "locked down" version of Windows for real time data acquisition.  Just asking for trouble.

Quote from: EricKelly on February 22, 2015, 09:55:19 AM
I also noticed that the error occurred more frequently as the session went on.  I am doing an analysis with a dozen elements, so I wonder if the amount of information in the file/memory is creating more opportunity for the error to occur.

Thanks for the new PFE version.  Let's hope that does the trick!

I'll do what I can but you need to get a clean version of Windows and re-install everything on your probe computer.  These "free" "secured" OS packages are anything but...
john
Title: Re: Could not lock file
Post by: Gseward on March 05, 2015, 08:04:02 PM
Here is a 'could not lock file' example posted in a different thread.

Quote from: jeb on November 13, 2014, 01:57:14 PM
I'm having issues analyzing the data in a particular MDB file, when I hit the "Analyze" button on particular unknowns (not on all of them) or try to output the data to an Excel file I get this error about not being able to lock the file (see attached image).  It seems to be particular to my computer (Windows 7, 32 bit), when I take it to a computer in the lab it analyzes everything just fine.  I tried putting the MDB file in a different folder/location and still get the same thing.  Any ideas?

Quote from: Gseward on January 23, 2015, 10:46:59 AM
I have had problems with this in the past. My observations seem to suggest it happens when the PC is being taxed. If I close all unneeded processes/applications it goes away.  Perhaps it is possible that there is a process running that is also trying to access/backup/interrogate the database file? i.e. anti virus, backup, recovery etc. Wild speculation, as always.

http://smf.probesoftware.com/index.php?topic=105.0
Title: Re: Could not lock file
Post by: John Donovan on March 05, 2015, 09:13:09 PM
Quote from: Gseward on March 05, 2015, 08:04:02 PM
Here is a 'could not lock file' example posted in a different thread.

Quote from: jeb on November 13, 2014, 01:57:14 PM
I'm having issues analyzing the data in a particular MDB file, when I hit the "Analyze" button on particular unknowns (not on all of them) or try to output the data to an Excel file I get this error about not being able to lock the file (see attached image).  It seems to be particular to my computer (Windows 7, 32 bit), when I take it to a computer in the lab it analyzes everything just fine.  I tried putting the MDB file in a different folder/location and still get the same thing.  Any ideas?

Quote from: Gseward on January 23, 2015, 10:46:59 AM
I have had problems with this in the past. My observations seem to suggest it happens when the PC is being taxed. If I close all unneeded processes/applications it goes away.  Perhaps it is possible that there is a process running that is also trying to access/backup/interrogate the database file? i.e. anti virus, backup, recovery etc. Wild speculation, as always.

http://smf.probesoftware.com/index.php?topic=105.0

I think my latest efforts may have fixed this issue.  But...

Please let me know if any of you experience this "could not lock file" error again.
john
Title: Re: Could not lock file
Post by: John Donovan on October 30, 2024, 04:18:40 PM
Just an update as we had a user run into this "Could not lock file" error again:

(https://smf.probesoftware.com/gallery/1_30_10_24_1_57_23.png)

followed by this error message:

(https://smf.probesoftware.com/gallery/1_30_10_24_1_57_39.png)

Looks bad, doesn't it(?), but turns out they were trying to access a probe database from a USB drive. The one thing Microsoft didn't get quite right in their Jet (DAO) database engine was the file locking on network drives, and now it appears USB drives.

It sometimes works (the user was able to get it to work after a bit), but if the drive access is slow, the file locking might report it was unable to do so. 

File locking is necessary for updating your probe database in case it happens to be opened by more than one application, e.g., Probe for EPMA *and* CalcImage.

Best practice is to copy your probe database, MDB (and BIM files if present), to your local hard drive. That way you'll never see this error and you'll have a backup copy of your data!