Wednesday, August 8, 2007

File Lock or Access Denied Error Message Solution

Are you trying to save an application data file and getting an error message that says
"Cannot read file. File is locked," or "Access Denied" or "Lock Error?"


Did you open the file using a universal naming convention (UNC) path?

A UNC path looks like this: \\computername\sharename.
Microsoft has a fix for this, or you can work around it by editing the registry.

IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs.

For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry
SYMPTOMS
When you try to save a file such as a Microsoft Excel workbook that you opened by using a universal naming convention (UNC) path, you may receive an error message that is similar to one of the following:
Cannot read file. File is locked

Access Denied

Lock Error
Event Viewer may contain the following event:

Event Type: Information
Event Source: Application Popup
Event Category: None
Event ID: 26
User: N/A
Description: Application popup: Windows - Delayed Write Failed : Windows was unable to save all the data for the file name_of_the_file_you_want_to_save. The data has been lost. This error may be caused by a failure of your computer hardware or network connection. Please try to save this file elsewhere. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp..../div>
class="cause">
CAUSE
This problem occurs when the redirector flushes the contents of the file, and writes to a file handle with read-only access instead of to a file handle with write access. When the redirector received an opportunistic lock break to none, it purged the cache for the file, but did not uninitialize the cache for the file. The redirector also needed to purge and uninitialize when the set end of file occurs because the opportunistic lock break is asynchronous. Because it did not uninitialize the cache for the file, it wrote to the incorrect file handle.
RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the problem described in this article. Only apply it to systems that are experiencing this specific problem. This fix may receive additional testing to further ensure product quality. Therefore, if you are not severely affected by this problem, Microsoft recommends that you wait for the next Windows XP Service Pack 2 that contains this fix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.

Windows XP SP1, Windows XP Tablet PC Edition

Date Time Version Size File name
--------------------------------------------------------------
30-Jan-2003 21:41 5.1.2600.1164 400,896 Mrxsmb.sys
30-Jan-2003 21:41 5.1.2600.1164 154,880 Rdbss.sys

Windows XP 64-Bit Edition

Date Time Version Size File name
-------------------------------------------------------------
30-Jan-2003 21:41 5.1.2600.1164 1,259,392 Mrxsmb.sys
30-Jan-2003 21:41 5.1.2600.1164 489,216 Rdbss.sys


WORKAROUND
WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk. To work around this problem, disable opportunistic locking on the file server:

1. Click Start, and then click Run.
2. In the Open box, type regedit, and then press ENTER.
3. In Registry Editor, locate the following subkey in the registry:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet \Services\LanmanServer\Parameters
4. In the right pane, click EnableOplocks, and then press ENTER.
5. In the Value data box, type 0, and then press ENTER.
6. Quit Registry Editor.

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION
For additional information about opportunistic locking, click the following article number to view the article in the Microsoft Knowledge Base:

296264 Configuring Opportunistic Locking in Windows 2000
A trace of this problem shows that the file is opened at least two times, and shows the system improperly writing to the read-only file handle. A trace that shows this problem is similar to the following:

96 CLIENT SMB: C NT create & X, File = \newshare.xls
SMB: Desired Access = 0x00020089
(Read Data,Read EA,Read Attributes)
97 SERVER SMB: R NT create & X, FID = 0x5
SMB: Oplock Level = Batch



450 CLIENT SMB: C NT create & X, File = \newshare.xls
SMB: Desired Access = 0x0002019F
(Read/Write Data, Read/Write EA, Read/Write Attributes)

451 SERVER SMB: R NT create & X, FID = 0xc007
SMB: Oplock Level = NONE



585 CLIENT SMB: C write & X, FID = 0x5, Write 0xc00 at 0x00005000
PID = 0xFEFF TID = 0x1002 MID = 0x4400 UID = 0x0801
586 SERVER SMB: R write & X - NT error, System, Error, Code = (34) STATUS_ACCESS_DENIED

Note The process identifier (PID) of 0xFEFF in frame 585 represents the client system process that is using the read-only file handle. It does not show the client program writing the data to disk.
The information in this article applies to:


* Microsoft Windows XP 64-Bit Edition

* Microsoft Windows XP Home Edition SP1

* Microsoft Windows XP Professional SP1

* Microsoft Windows XP Professional SP1

0 Comments: