English

Problem: Cannot acquire a lock while accessing data on a file share

Description

When performing various workflows within ArcGIS for Desktop, users may experience the error that a lock cannot be acquired. If this data exists on a file share such as a Network Attached Storage (NAS) or other device using Samba, there may be a problem with the Windows SMB2 cache. Users may experience this issue when a program creates a file, such as a lock file, and then verifies the file exists immediately after creation.

Cause

This problem is due to an issue within the SMB2 Client Redirector cache. At the Windows Vista and Server 2008 release, three file metadata caches were implemented to speed up the return of the most recently accessed file and directory information. However, by default, at the Windows 7 and Server 2008 R2 releases, these caches are set to refresh every ten seconds. In the case of ArcGIS for Desktop lock creation, this cache regeneration is not fast enough.

For more information, see the following Microsoft TechNet article: SMB2 Client Redirector Caches Explained

Solution or Workaround

To resolve this issue for ArcGIS for Desktop, the registry must be updated to disable the SMB2 caching.

  1. As a computer administrator, open the Start menu and type regedit.exe to open the Registry Editor.
  2. Navigate to the following registry key:


    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Lanmanworkstation\Parameters

  3. Check to see if the name DirectoryCacheLifetime exists within the key.
  4. If the name does not exist, create a new DWORD called DirectoryCacheLifetime.
  5. Once the name DirectoryCacheLifetime exists modify the DWORD value to be 0.

    [O-Image]