mackup icon indicating copy to clipboard operation
mackup copied to clipboard

Permission denied

Open boetter opened this issue 10 years ago • 12 comments

Any idea why this might be happening to me?

Screenshot

boetter avatar Feb 07 '15 13:02 boetter

Mackup does not seem to be able to move .shsh/.cache/lib-osx.jar Frankly, I think the app config is bad, as Mackup should not try to sync cache files, and .shsh/.cache is an obvious name.

@stechico you added support for this https://github.com/lra/mackup/blob/master/mackup/applications/shsh-blobs.cfg, any idea?

lra avatar Feb 07 '15 21:02 lra

I'm getting the exact same error just it occurs when I try to backup my oh-my-zsh config file. Is there any way to modify the oh-my-zsh app config to ignore the .git directory? screen shot 2015-08-24 at 8 40 28 pm

nickolson avatar Aug 25 '15 00:08 nickolson

No: https://github.com/lra/mackup/issues/602

lra avatar Aug 26 '15 16:08 lra

I'm getting the exact same error and Traceback as @boetter

jwmann avatar Sep 16 '15 20:09 jwmann

I just upgraded through Homebrew and seems the bug is still the same.

screen shot 2015-09-16 at 22 31 40

boetter avatar Sep 16 '15 20:09 boetter

@boetter I encountered this same error just now. The issue seemed to be that I didn't have Dropbox open and actively connected. Whilst my files has sync'd to my Dropbox folder, it needed an active connection to work.

olimorris avatar Jan 29 '17 00:01 olimorris

Same with me. just installed and got this error:

OSError: [Errno 13] Permission denied: '/Users/petrkorolev/.shsh/.cache/lib-osx.jar'

skywinder avatar Sep 08 '17 16:09 skywinder

2 years later and still have this issue.

jwmann avatar Oct 03 '17 20:10 jwmann

I'm having the exact same problem on Ubuntu 18.04

Restoring .oh-my-zsh/custom ...
You already have a folder named .oh-my-zsh/custom in your home.
Do you want to replace it with your backup ? <Yes|No>yes
Traceback (most recent call last):
  File "/home/dizzi/.conda/envs/mcup/bin/mackup", line 8, in <module>
    sys.exit(main())
  File "/home/dizzi/.conda/envs/mcup/lib/python3.7/site-packages/mackup/main.py", line 120, in main
    app.restore()
  File "/home/dizzi/.conda/envs/mcup/lib/python3.7/site-packages/mackup/application.py", line 201, in restore
    utils.delete(home_filepath)
  File "/home/dizzi/.conda/envs/mcup/lib/python3.7/site-packages/mackup/utils.py", line 68, in delete
    shutil.rmtree(filepath)
  File "/home/dizzi/.conda/envs/mcup/lib/python3.7/shutil.py", line 498, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/home/dizzi/.conda/envs/mcup/lib/python3.7/shutil.py", line 496, in rmtree
    os.rmdir(path)
PermissionError: [Errno 13] Permission denied: '/home/dizzi/.oh-my-zsh/custom'

nicofirst1 avatar Jun 09 '20 09:06 nicofirst1

ok, unless someone has a fix, the only thing I can do is remove support for oh-my-zsh and shsh.

lra avatar Jun 09 '20 21:06 lra

I've got a similar message for a different app: PermissionError: [Errno 13] Permission denied: '/Users/asapinto/.config/filezilla'

asapsmc avatar Jul 23 '21 18:07 asapsmc

And I'm getting this issue for DefaultKeyBinding.dict:

$ mackup backup

Mackup needs a directory to store your configuration files
Do you want to create it now? </Users/username/Library/Mobile Documents/com~apple~CloudDocs/Mackup> <Yes|No>Yes
Backing up .ansible ...
Backing up Library/Preferences/com.apple.Music.eq.plist ...
Backing up Library/Preferences/com.apple.Music.plist ...
Backing up .asdfrc ...
Backing up .bashrc ...
Backing up .bash_profile ...
Backing up .profile ...
Backing up .bundle/config ...
Backing up Library/KeyBindings/DefaultKeyBinding.dict ...
Traceback (most recent call last):
  File "/usr/local/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.32', 'console_scripts', 'mackup')())
  File "/usr/local/Cellar/mackup/0.8.32/libexec/lib/python3.9/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/usr/local/Cellar/mackup/0.8.32/libexec/lib/python3.9/site-packages/mackup/application.py", line 119, in backup
    utils.delete(home_filepath)
  File "/usr/local/Cellar/mackup/0.8.32/libexec/lib/python3.9/site-packages/mackup/utils.py", line 66, in delete
    os.remove(filepath)
PermissionError: [Errno 13] Permission denied: '/Users/username/Library/KeyBindings/DefaultKeyBinding.dict'

This file is readable

-rw-r--r--  1 root  staff   606B Jan 11  2021 /Users/username/Library/KeyBindings/DefaultKeyBinding.dict

But mackup obviously tries to delete it and this is obviously not possible without sudo access.

So if mackup sees insufficient rights, it could propose

  1. becoming sudo
  2. changing permissions
  3. changing the owner
  4. skipping this particular backup and echo a warning

I fixed it by executing

$ sudo chown $USER "$HOME/Library/KeyBindings/"
$ sudo chown $USER "$HOME/Library/KeyBindings/DefaultKeyBinding.dict"

Personally I think that mackup could propose something like this in it's error message (a ready copy n paste friendly command). This way a user could still decide what to do.

alexanderadam avatar Sep 19 '21 14:09 alexanderadam