The operation can’t be completed. (OSStatus error 0.)

macOS 'The operation can’t be completed' Error Fix

macOS Errors Intermediate 👁 0 views 📅 May 27, 2026

This generic macOS error usually means a file path is too long or a permission is borked. Here's how to fix it fast.

1. File Path Too Long — The Most Common Culprit

I see this one constantly. You're copying a folder full of nested subfolders — maybe a project with node_modules, or a photo library structure from 2012 — and boom: The operation can’t be completed because an unexpected error occurred (Error code -0). The real problem is almost always a file path longer than macOS's 255-character limit.

Don't bother renaming the whole folder tree. Instead, find the deep files:

  1. Open Terminal (Finder > Applications > Utilities > Terminal)
  2. Navigate to the problem folder: cd /path/to/your/folder
  3. Run this to list files with paths over 255 characters:
    find . -type f -name '*.png' -o -name '*.jpg' -o -name '*.pdf' 2>/dev/null | while read f; do if [ ${#f} -gt 200 ]; then echo "$f"; fi; done
  4. Shorten the offending file names or move the whole folder closer to root (like /Users/you/temp/)

This fix works maybe 70% of the time. If the error still shows up, move on to the next cause.

2. Stale File Permissions

Second most common cause: macOS got confused about who owns what. This happens after a migration, a Time Machine restore, or when you've been messing with chmod or chown.

Skip the GUI Disk Utility repair — that rarely fixes permission issues on user files. Instead, reset the folder's permissions with Terminal:

# Replace /path/to/folder with your actual path
sudo chown -R $(whoami):staff /path/to/folder
sudo chmod -R u+rwX /path/to/folder

The first command sets you as the owner. The second gives you read/write/execute access. Don't forget the capital X in chmod — that applies execute only to directories, not regular files. A common mistake I've seen juniors make.

If you're on a network drive or a mounted volume, permissions may be locked by the server. In that case, copy the files to your local Desktop first, then move them where you need.

3. Corrupted .DS_Store File or Disk Errors

Less common but sneaky. The Finder's .DS_Store file can get corrupted on a folder and cause this error when you try to open or move it. The fix is simple: delete that hidden file.

  1. Open Terminal
  2. Go to the problem folder: cd /path/to/folder
  3. Delete the DS_Store: rm .DS_Store

Still broken? Run First Aid on the disk. The culprit here is almost always a bad block or directory structure issue. Open Disk Utility, select your startup disk, click First Aid > Run. Let it finish — this can take 10 minutes on a large drive. If it finds and fixes errors, try the operation again.

One specific scenario: I've seen this error pop up on APFS volumes after a macOS update (especially from Monterey to Ventura). The update leaves a stale snapshot. If First Aid shows "Snapshot is invalid" or similar, boot into Recovery (Intel: Cmd+R at startup, Apple Silicon: hold power button) and run Disk Utility from there. That fixes the snapshot issue clean.

Quick-Reference Summary Table

CauseFixTools
File path > 255 charsShorten names or move folder to rootTerminal find command
Wrong permissionsReset all permissions with chown/chmodTerminal
Corrupt .DS_Store or diskDelete .DS_Store, then run First AidTerminal + Disk Utility

Start with the path length check. That's your best bet. If none of these work, the file itself might be damaged — try restoring from a backup before it gets worse.

Was this solution helpful?