Quick answer for pros
Set DisableLeasing to 1 on the server's share or registry. Or force SMB 1.0 if you're stuck (don't, but it works).
What this error actually means
You're getting 0X00001A9E when a program opens a file with transactions over SMB. The remote server sends back a version number or file ID that doesn't match what your client expects. I've seen this mostly with database apps — SQL Server, Access, or custom software that uses transactional file operations. The culprit here is almost always SMB 2.x lease handling (oplock mechanism). SMB 2.1 and 3.0 introduced directory leases and oplock batching. When two clients or a client and a server disagree on the file's state, boom — you get this mismatch. I've fixed this on Windows Server 2012, 2016, and 2019, and on Windows 10/11 clients.
Don't bother with chkdsk or drive checks. It's not a disk problem. It's a protocol negotiation problem.
Fix steps
- Check your SMB version. On the server, run
Get-SmbConnection | flin PowerShell. If it shows SMB 2.1 or 3.x, that's likely the issue. SMB 1.0 doesn't have this problem, but you shouldn't use it (security nightmare). - Disable leasing on the problematic share. On the server (where the file lives), open PowerShell as admin and run:
This turns off SMB2 leases for that share. It forces the server to send stable version numbers. No reboot needed — changes take effect immediately.Set-SmbShare -Name "YourShareName" -DisableLeasing $true - If that doesn't work, disable oplocks on the server. Oplocks are a different part of SMB. Disable them via registry:
Then restart the Server service:reg add "HKLM\System\CurrentControlSet\Services\LanmanServer\Parameters" /v EnableOplocks /t REG_DWORD /d 0 /fnet stop server && net start server. Or just reboot. - Or disable oplocks on the client. Sometimes the client's oplock handling is the problem. On the client machine, set:
Restart the workstation service:reg add "HKLM\System\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v EnableOplocks /t REG_DWORD /d 0 /fnet stop workstation && net start workstation. - Force SMB 1.0 as a last resort. I hate recommending this because SMB1 is insecure, but if you're in a closed network and need it working now:
- On the server:
Enable-WindowsOptionalFeature -Online -FeatureName smb1protocol - On the client: same command
- Then restart both machines.
- On the server:
Alternative fixes if main steps fail
If disabling leases and oplocks didn't work, check for antivirus. Some AV software intercepts SMB traffic and corrupts oplock negotiations. Temporarily disable it on the server and client to test. I've seen Bitdefender and McAfee cause this.
Also check if the file is on a DFS share. DFS can add extra versioning complexity. Try accessing the file directly via the server's IP instead of the DFS path.
If you're using Windows Server 2012 R2, there's a known bug with SMB2 leases. Install KB2982006 or later cumulative updates.
Prevention tip
If your apps use transactional file operations (like databases), avoid storing them on SMB shares. Use local storage or iSCSI if possible. SMB is great for file sharing, but transactional operations over the network are fragile. If you must use SMB, keep SMB 3.0 or later, disable leasing on the share, and keep all machines patched.