You're dragging a folder to the Trash, or maybe you're trying to open a PDF from Downloads, and bam—a dialog box pops up: "The operation can’t be completed because the item is in use." Or sometimes it says "because an unexpected error occurred (error code -50)." Either way, you're stuck, and it's infuriating. I've seen this on everything from macOS Catalina to Sonoma, and it usually strikes when you're dealing with a file that's been partially downloaded, synced from iCloud, or that has weird permission bits left over from a previous user.
Why this happens
Under the hood, macOS relies on a database called the desktop services store (the .DS_Store file and the Spotlight index). When that database gets corrupted or stale, Finder gets confused about what's actually open, what's a folder, or what's safe to delete. The error is basically Finder's way of saying, "I've lost track of this item." It's not your fault, and it's not a hardware failure—it's a software glitch that's fairly easy to fix.
The real fix: clear the cache, then repair permissions
Skip the advice about force-quitting Finder and restarting your Mac—that's a band-aid. Here's what actually works, in order. Do the first step; most times that's all you need.
- Quit Finder properly. Click the Apple menu, choose Force Quit, select Finder, and click Relaunch. That clears the immediate memory state. If the error persists, move to step 2.
- Clear the desktop services store. Open Terminal (Finder → Applications → Utilities → Terminal) and run this command:
This deletes those hidden metadata files that Finder uses to remember icon positions and folder views. It sounds scary, but it's safe—macOS recreates them on the fly. You'll need to enter your admin password. After it's done, restart your Mac.sudo find / -name .DS_Store -delete - Run Disk Utility First Aid. If the error still shows up, the disk might have minor directory corruption. Open Disk Utility (from the Utilities folder), select your startup drive (usually Macintosh HD), and click First Aid. Let it run—it takes a few minutes. This will repair permissions and check the file system structure.
- Reset NVRAM/PRAM (Intel Macs only). If you're on an Intel-based Mac and steps 2–3 didn't work, shut down, then turn it on and immediately press Option + Command + P + R for about 20 seconds. You'll see the screen flash—let it restart normally. On Apple Silicon (M1/M2/M3), you don't need this; just do a standard restart.
What if it still fails?
Rarely, the error is tied to a specific third-party app that's holding the file open. Check your menu bar for any sync apps like Dropbox, OneDrive, or Google Drive. Quit them all (right-click their icons and choose Quit), then try the operation again. If that works, you know one of those apps is the culprit—you might need to reinstall it.
Also, if the file is on an external drive or a network volume, the same error can appear when the connection is flaky. Copy the file to your Desktop first, then try again. Finally, if you're dealing with a file that won't delete, try this Terminal command (replace /path/to/file with the actual path):
rm -rf /path/to/file
That forces deletion without Finder's permission checks. Only use it if you're certain you don't need the file.
In my six years running a help desk, I'd say 90% of these errors disappear after the .DS_Store cleanup and a restart. The other 10% need the Disk Utility fix. Stick with the order above, and you'll be back to work in ten minutes flat.