If you've been on a Mac for more than a year, you've probably hit this wall: you try to move a file, delete a folder, or even empty the Trash, and macOS throws up that maddening "The operation can't be completed because an unexpected error occurred (error code -36)" — or sometimes just a generic version with no code at all. It's vague, it's annoying, and it stops your workflow dead.
I've fixed this for dozens of small business clients, and the same three causes keep showing up. Here they are, most common first, with the fixes that actually work. Skip the disk utility voodoo — start with the first one.
Cause #1: You're Trying to Copy or Delete a File That's Locked or In Use
This is the one I see almost weekly. A client is trying to move a QuickBooks backup or a Photoshop file that either has the locked flag set or is still open in another app. The Finder doesn't tell you why it's failing — it just gives you that cryptic error.
The fix: Unlock the file first, then make sure nothing's using it.
- Right-click the file (or press
Cmd+I) to get Info. - Look at the General section. If you see a checkbox for Locked, uncheck it.
- Close any app that might have that file open. If you're unsure, just restart the app — or the whole Mac if you're not sure.
- Try the operation again.
For locked files in the Trash, you'll get a different error — "The operation can't be completed because the item is locked" — but the fix is the same. Unlock it, then empty the Trash.
If the file is on a shared network drive or a USB drive, eject and reconnect it. I've had a client whose entire accounting folder was on a USB stick that got yanked mid-write. After remounting, the error vanished.
Cause #2: Finder Has a Corrupted Cache or a Stuck Process
When the error appears on every operation — even renaming a file on your Desktop — Finder itself is the problem. A stale cache or a hung process can make Finder act like it's drunk. This is the second most common cause.
The fix: Kill Finder and clear its caches. It sounds scary, but it's harmless.
- Press
Option+Cmd+Escto open the Force Quit window. - Select Finder and click Relaunch. Finder restarts instantly, no data loss.
- If that doesn't help, run this in Terminal:
rm -rf ~/Library/Caches/com.apple.finder
killall Finder
That deletes Finder's cache folder and restarts it. You'll see your Desktop icons disappear and come back. No harm done.
I had a client last month whose print queue died because of this same Finder bug. After the cache wipe, both the printing and file operations worked again.
Cause #3: Corrupted File Metadata or the File Itself
Sometimes the file is fine, but macOS reads its metadata wrong — especially if it came from a Windows machine, a cloud sync, or an old external drive. The file might have invalid permissions, a weird extended attribute, or a spot in the directory structure that Finder can't handle.
The fix: Fix permissions and strip extended attributes.
- If the file is on your drive, open Disk Utility → select your startup disk → First Aid → Run. This checks and repairs the directory. Usually it finds nothing, but it's worth a try.
- For a specific file or folder, open Terminal and run:
sudo chflags -R nouchg /path/to/your/file
sudo chmod -R 755 /path/to/your/file
That recursively removes the locked flag and sets permissions to readable/writable by you. Replace the path with the actual location — drag the file into Terminal to fill it automatically.
- If the file came from another computer, strip those weird attributes:
sudo xattr -cr /path/to/your/file
That clears all metadata like quarantine flags and source labels. I've seen this fix files that thought they were "read-only" even though permissions said otherwise.
If the file is on an external drive, copy it to your Desktop first, run the commands there, then move it back. Don't ski the copy step — I've seen drives with failing sectors throw this error constantly.
Quick Reference
| Cause | Symptom | Fix |
|---|---|---|
| Locked or in-use file | Error on a specific file or folder | Unlock in Info, close apps, remount drive |
| Finder cache/process issue | Error on everything | Relaunch Finder, clear cache |
| Corrupted metadata or file | Error on files from other systems | Disk Utility, chflags, chmod, xattr |
Try these in order, and nine out of ten times you'll be back to work in under five minutes. If the error still shows up after all three, copy the file to a new location, rename it, and see if that breaks the curse. That's usually enough to reset whatever gremlin is stuck in there.