Why do I receive error code 0 when copying files in macOS?
"The operation can't be completed because an unexpected error occurred (error code 0)."
It was frustrating because the error occurred nearly two hours into the process, and I had to restart the backup. I tried it again and got the same error. Through trial and error, I backed up smaller sections of my home folder and eventually traced the issue to the OneDrive folder located at:
I deselected the CloudStorage folder and was able to backup my Library folder and the rest of my home folder successfully.
I did some research and learned "error code 0" may occur when copying files from a FAT32 file system to macOS. Based on this information, it makes sense that Microsoft's OneDrive folder was the culprit. However, it was still challenging to isolate the problem CloudStorage/OneDrive folder, especially when I copied over 1.5 million files.
▶ If you encounter a generic error when copying files, you can locate the cause by copying smaller sections of the folder (or drive). When the error appears, copy individual folders within the directory until you isolate the problematic folder or file.
In the case of macOS error code 0, it's most likely a file system conflict caused by a Windows-formatted storage device. If you use OneDrive, deselecting the CloudStorage/OneDrive folder should be an easy fix.