File Locked Errors
Resolution Checklist
- 1 Understand File Locking Mechanics in Cloud Storage
- 2 Release File Locks on Windows Using Resource Monitor and PowerShell
- 3 Kill Locking Processes and Clear Handles on macOS
- 4 Resolve Server-Side Locks and Check-Out Status
- 5 Summary Quick Reference Checklist
File Locked Errors
“File Locked” errors occur when a cloud sync client (e.g., OneDrive, SharePoint, Google Drive, or Dropbox) cannot upload or update a file because it is locked by an operating system process or checked out by another user. You may see error codes like “The file is locked by another process” or “Cannot sync: File in use”.
This guide provides steps to identify the applications holding locks on your files, force release those handles, and resolve server-side co-authoring lockouts on both Windows and macOS.
1. Understand File Locking Mechanics in Cloud Storage
A file can be locked in three distinct ways:
- Local File Handle Lock: A local application (e.g. Word, Excel, Photoshop, or a software compiler) has opened the file and flagged it with an exclusive OS write lock. The cloud client cannot read the file stream.
- Server-Side Lock (Co-Authoring Lock): A co-worker has opened the file in an editor that places a temporary collaboration lock on the cloud server.
- Check-Out Lock: The document library (especially in SharePoint or Teams) is configured to require files to be checked out before editing, blocking sync clients from updating the server version.
2. Release File Locks on Windows Using Resource Monitor and PowerShell
Windows prevents files from being modified or read when an open handle exists.
A. Identify and Terminate Locks using Resource Monitor
- Press
Ctrl + Shift + Escto open Task Manager. - Go to the Performance tab and click Open Resource Monitor at the bottom.
- In Resource Monitor, go to the CPU tab.
- Expand the Associated Handles section.
- In the Search Handles box, type the name of the locked file.
- Right-click the process holding the handle (e.g.,
winword.exe) and select End Process.
B. Force Handle Release with PowerShell
If the file is locked in an active development directory:
# Identify processes accessing files within a target path
Get-Process | Where-Object {$_.Modules.FileName -like "*your-file-name*"} | Stop-Process -Force
3. Kill Locking Processes and Clear Handles on macOS
On macOS, you can find the application locking your files using the terminal utility lsof and kill it.
A. Locate and Force Close Locked Files via Terminal
- Open Terminal (via Spotlight).
- Use the
lsofcommand to search for open handles in your cloud directory:# Search for open file handles on a specific file lsof "/Users/$(whoami)/Library/CloudStorage/OneDrive-Personal/stuck-file.xlsx" - Terminal will output the process name (COMMAND) and process ID (PID). For example:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Excel 12450 derek 5u REG 1,4 10485760 123456 stuck-file.xlsx - Terminate the application using the PID:
kill -9 12450
B. Clear Hidden System Lockfiles
Sometimes, Microsoft Office or Adobe leaves hidden lock files behind. Clean them out of your sync directories:
# Delete temporary lock files in your CloudStorage directory
find ~/Library/CloudStorage -type f -name "~$*" -delete
4. Resolve Server-Side Locks and Check-Out Status
If local processes are closed but the cloud warns the file is locked by “Another User” or “System”:
A. Cancel Check-Out or Discard Changes (SharePoint / OneDrive)
- Go to your cloud storage web interface (e.g. OneDrive/SharePoint online).
- Right-click the locked file.
- Select Version History or Manage Access.
- If the file is Checked Out, click More > Check in or Discard check-out.
B. Wait out the Co-Authoring Lock TTL (Time-To-Live)
If a user closes their Office client abruptly (e.g., network loss, computer crash), the server-side lock remains active.
- Time-To-Live: Server locks automatically expire after 10 to 15 minutes of inactivity. Avoid modifying the file during this cooling-off period to prevent conflict copies.
5. Summary Quick Reference Checklist
| Action Target | Operating System | Terminal Command / Path | Expected Outcome |
|---|---|---|---|
| Search Handle | Windows | Resource Monitor > CPU > Associated Handles | Finds the process holding the file lock. |
| Kill Process | Windows | taskkill /f /im <process.exe> | Releases the local OS-level lock on the file. |
| List Open Handles | macOS | lsof <file-path> | Identifies the macOS process ID locking the file. |
| Force Release PID | macOS | kill -9 <PID> | Terminates the locking process instantly. |
| Clear Lockfiles | macOS | find <path> -name "~$*" -delete | Purges orphaned Office lockfiles. |
| Discard Check-out | Cloud Web Console | Document Library > File Options | Frees server-side checkout blocks for co-workers. |