Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Can't copy a folder, getting error code -41

I can't copy or duplicate a folder. Doesn't seem to matter where I try to copy it (through finder). I seem to have the appropriate permissions. I checked disk utility and it said the disk was okay. Here is the full error:

*The operation can’t be completed because an unexpected error occurred (error code -41).*

I'm using Mac OS X Server 10.6.5 but this forum seemed more appropriate given the issue. The size of the folder is around 260MB. The folder is a grails project.

Can anyone please help me? This is really frustrating.

Thanks,
Ian

Mac Mini, Mac OS X (10.6.5)

Posted on Jan 7, 2011 8:56 AM

Reply
15 replies

Jan 11, 2011 4:54 AM in response to SystemicRisk

The drive I'm having problems copying from is also configured as RAID (Raid 0 with 2x1TB discs).

I've worked round the problem by creating a new library and re-importing all the data. Only difference I could see was that the internal database had many less versions (as expected). I can now copy the file around fine - so it seems to be something to do with the paths it has to traverse rather than the size of the data. Very odd.

Jan 20, 2011 6:30 AM in response to HotFeet

If you get an error code -41 when trying to copy a folder, check the permissions on the folder to see if it has an ACL. If it does, then it's likely that you'll need to delete the ACL before you can copy successfully. If you delete the ACL, you will need to choose "Apply to enclosed items" as well.

The problem is that OS X 10.6.5 introduced a bug in how the Finder handles ACLs when copying. In short, it duplicates and adds ACEs while copying. The more levels of sub-folders being copied, the greater the duplication. If the Finder's duplication results in attempting to apply more than 127 ACEs to a file's ACL, then it will fail to copy and return the error code -41.

This also applies to bundle files, such as iPhoto and Aperture libraries.

Of course, it's possible that you might be getting this error for some other reason, but I would certainly check for ACLs.

Message was edited by: Seph

Jan 22, 2011 1:16 AM in response to Seph

I was able to fix my problem, and thought I would let you guys know what I did. As stated earlier I would get the error-41 every time I tried to copy a large directory to another location. As things progressed my computer response(it's a server - macmini) became terrible. I couldn't figure out the problem, so I disconnected all external hard drives - This includes two I was using for TimeMachine. One for the server backup, the other to backup various computers on the network.

After reboot, computer responded fine. Log story short, Time Machine was bogging down the system big time, and was the problem to slow response, and the -41 error I was receiving.

So here is my word of wisdom to you. If you are using TimeMachine and are having issues, even if they seem un-related, try turning Time Machine off.

James

Mar 9, 2011 9:57 PM in response to SystemicRisk

I guess Time Machine stinks still. I just had the same type of problems. I was trying to back up using it and got a "failure". Seems Time Machine did not delete the former back up and my backup partition did not have enough space. So I tried a manual backup to another partition and got the error 41. Now I did what was suggested and changed the permissions and am copying so we'll see what will happen. Its about 1/4 way thru now; hope it continues.

Mar 20, 2011 11:05 AM in response to SystemicRisk

Yes, "cp -Rp" will treat ACLs properly and not duplicate like Finder, "cp -R" just ignores them, whatever works... but file a bug if you want this fixed (bugreporter.apple.com)

For those who want to fix their files that have tons of ACL you can kill them all, make a textedit (text only Command-Shift-T), paste this in:
#!/bin/bash
IFS=$'\t\n'
find "${@}" -exec chmod -N {} \;

Open terminal and add the execute bit with: chmod +x <drag file from finder into terminal> <Enter>

Then run with the name of the path as the argument... for more detail
http://hints.macworld.com/article.php?story=20070501065737278

For the troubleshooters:
I got it down to the bare minumum on a clean OS X Server install, not AD bound or anything extraneous. Just AFP running on a server with an IP with forward reverse lookup. I made a share, added admin (501) to the ACL (as Read only), touched a file and duplicated it in Finder, locally on the server.

10.6-10.6.2 functioned fine. 10.6.3 and 10.6.4 added bizarre behavior where a WRITE ACE was added to the ACL, but the ACEs weren't "stacking up", 10.6.5 and 10.6.6 added the redundant ACEs that when you tried copying/duplicating packages and apps with Finder would result in insane amounts of duplication, try Chess.app you'll get 18 ACEs deep in one Finder copy! 3rd copy fails with Error -41

So get reporting folks, 10.6.7 might be the last Snow Leopard update, and even if it isn't I'm getting pretty tired of dealing with this bug and don't want to wait until 10.6.8! So I just filed my bug #9160099 (another poster referenced his bug #8816661, that 343,438 bug reports later!)

Can't copy a folder, getting error code -41

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.