1. If you're receiving a message that you are banned from the Current Events or Politics forums, it's not you specifically: those forums have been hidden for all users. For more info, see here.
    Dismiss Notice

How to fix error code -43 (copying files to my samba shares)?

Discussion in 'Apple Desktop Hardware/Software' started by mrjayviper, Apr 16, 2014.

  1. mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    460
    Hello. When I copy some files/apps to my samba shares (1 running FreeBSD and the other is running Debian Linux), I get an error code -43.

    this is the text of the error message

    Code:
    operation cannot be completed as one or more required items cannot be found
    This doesn't happen to all apps. I've encountered the problem copying calibre/ripit/textwrangler and possibly more. But I didn't get the error copying Chrome/VNC viewer and possibly more as well.

    I tried copying the files using the cp command and I was getting "cannot copy extended attributes" error. After removing the extended attributes via

    Code:
    xattr -rc calibre.app
    and confirming the extended attributes are gone by running

    Code:
    xattr calibre.app
    and I am still getting the same error. I tried copying Google Chrome which I don't have any problem with copying using drag-and-drop and I get no errors at all.

    I've searched the net and I found an Apple support article but I don't think it applies to me. I found numerous discussions on the topic but nothing really helpful.

    Any ideas on how this can be avoided or perhaps a workaround? At the moment, the only workaround I can think of is to tar my files first before copying to my network shares.

    thanks very much for the help :)
     
    Last edited: Apr 16, 2014
  2. Hyram

    Hyram Member

    Joined:
    Jan 19, 2009
    Messages:
    820
    Eric, a -43 almost always means an illegal character in the path somewhere. Sometimes even an embedded space can be enough to upset it. The "Can't be found" aspect applies not only to the source, but to the destination.

    As the KB says, the illegal characters are:

    ? [ ] / \ = + < > ; : " , | *

    You can see for yourself if the paths have illegals by using TextWrangler: open a new document, then insert file/folder paths of the directories that are giving you problems, then search for the most likely suspects ([ ] = +).

    If all you are doing is archiving stuff to the server, zip the encompassing folder on the Mac first and then transfer the archive.

    Don't try to run Mac OS stuff off a non-Mac server.
     
    Last edited: Apr 16, 2014
  3. OP
    OP
    mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    460
    I just did more investigation and it seems when running cp or rsync (which I just tried now), my problems seems to revolve around symlinks and the system cannot see or follow it.

    Code:
    chiyo:others chiyo-chan$ rsync -alprt calibre.app/ /Volumes/storage-yomi/temp/others/
    rsync: failed to set times on "/Volumes/storage-yomi/temp/others/Contents/Frameworks/QtCore.framework/QtCore": No such file or directory (2)
    rsync: failed to set times on "/Volumes/storage-yomi/temp/others/Contents/Frameworks/QtCore.framework/Versions/Current": No such file or directory (2)
    
    I'm looking at various options of cp/rsync but nothing seems to help.

    I've looked at the file path and there are no invalid characters that I can see
     
  4. Hyram

    Hyram Member

    Joined:
    Jan 19, 2009
    Messages:
    820
    The answer to that is stop treating Mac OS X as if it were linux.

    No, I'm not joking. Do not arbitrarily lash about with symlinks, do not treat OSX applications as if they were just files, do not play around with permissions (especially XATTR), and most importantly heed the cardinal rule:

    Never EVER manually upgrade, downgrade, move, edit, delete or otherwise change ANY file installed by Apple.

    And never ever run as 'root' except under special circumstances, and only then for once-off jobs requiring that level of access.

    The OS is self-protecting and actively tinker-hostile, because Apple hard-code to their own code-base extensively.

    Apple's commandline is and always shall be a second-class citizen, and in all likelihood will not be present as a standard feature-set in the next major revision of Mac OS X. (If you want it, you will need to install XCode, because that's where the userland is being moved to.)
     
  5. OP
    OP
    mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    460
    Calibre is not something installed by apple...


    In saying that, i'm giving up for now and won't backup my osx apps on the file server since it's backed up in two places anyway.

    Thanks for the help
     
  6. Hyram

    Hyram Member

    Joined:
    Jan 19, 2009
    Messages:
    820
    I know it isn't. I used to use it myself, but it is the most ugly, ungainly, non-compliant piece of open-sores to appear on the internet since Firefox. I'm just warning you, you can't approach OSX like any other *nix you may be familiar with. "Because Apple" is a legitimate reason for why things never really quite work the way you expect them to :)

    Oh, you can back them up, you just have to package them up into something friendly to non-OSX. The best way is to use a .dmg (compressed or not).
     
  7. plasticbastard

    plasticbastard Member

    Joined:
    Jul 30, 2003
    Messages:
    4,004
    Location:
    Sector ZZ9 Plural Z Alpha
    Are you sure you've got rsync syntax correct? You need to be careful when using the trailing / at the end of a path as including it or not changes the way a recursive rsync works. The same is true for cp.

    Your error message when rsync'ing the app indicates the rsync is copying the contents of blah.app into the share, as share/Contents/, when it should be copying as share/blah.app/Contents/

    I think if you remove the trailing / after blah.app you might see better results.
    You can confirm this by reading the man for rsync re above mentioned behaviour of trailing / in your commands.

    Also, in your rsync you're using flags -alprt. You only need to use -a, as -a does the same as -rlptgoD (no -H).

    I would suggest you try this in dry run mode first (the -n flag) - you will have verbose (-v) output that is human readable (-h). If you want progress, add in --progress (you will need -h IIRC):
    Code:
    rsync -avhn /path/to/your.app /path/to/volume/
    
    See what problems arise (if any) and then drop the -n flag if it all works fine.

    If you're using cp, then I suggest using cp -Rv (-r is not in the Mac OS X cp binary). if you're getting problems about resource forks, try -X as well.

    If you have hardlinks in any of the folders you want to copy, your best solution is to tarball then cp/rsync.
     
    Last edited: Apr 17, 2014
  8. OP
    OP
    mrjayviper

    mrjayviper Member

    Joined:
    Jul 18, 2012
    Messages:
    460
    I'm using

    Code:
    rsync -althrv
    
    Code:
    cp -a (resolves to cp -pPR)
    
    -----------

    Tarring my files first and then sending them to the file server is something I've thought about but at the expense of convenience. But my apps are backed up on the MacPro and the MBPr and the 2.5" SATA drive I used to transfer stuff between them so it's not as critical anymore.

    Thanks everyone :)
     
  9. plasticbastard

    plasticbastard Member

    Joined:
    Jul 30, 2003
    Messages:
    4,004
    Location:
    Sector ZZ9 Plural Z Alpha

    My post was pointing out you don't need the -ltr flags if you use -a in rsync. -a does that automatically (per Mac OS X man for rsync).
     

Share This Page

Advertisement: