Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial backup fails with symlink problems on iterm2 #1925

Open
pjknowles opened this issue Jun 15, 2023 · 18 comments
Open

Initial backup fails with symlink problems on iterm2 #1925

pjknowles opened this issue Jun 15, 2023 · 18 comments

Comments

@pjknowles
Copy link

Mackup 0.8.37

% mackup backup
Mackup needs a directory to store your configuration files
Do you want to create it now? </Users/sacpjk/Library/CloudStorage/Dropbox/Mackup> <Yes|No> Yes
Backing up Library/Preferences/com.kapeli.dashdoc.plist ...
Backing up .docker/config.json ...
Backing up .docker/daemon.json ...
Backing up Library/Preferences/espanso ...
Backing up Library/Application Support/GIMP/2.10/devicerc ...
Backing up Library/Application Support/GIMP/2.10/templaterc ...
Backing up Library/Application Support/GIMP/2.10/pluginrc ...
Backing up Library/Application Support/GIMP/2.10/parasiterc ...
Backing up Library/Application Support/GIMP/2.10/menurc ...
Backing up Library/Application Support/GIMP/2.10/themerc ...
Backing up Library/Application Support/GIMP/2.10/sessionrc ...
Backing up Library/Application Support/GIMP/2.10/colorrc ...
Backing up Library/Application Support/GIMP/2.10/unitrc ...
Backing up Library/Application Support/GIMP/2.10/gimprc ...
Backing up Library/Application Support/GIMP/2.10/controllerrc ...
Backing up Library/Application Support/GIMP/2.10/contextrc ...
Backing up Library/Application Support/GIMP/2.10/toolrc ...
Backing up Library/Application Support/GIMP/2.10/dockrc ...
Backing up .gitconfig ...
Backing up .hammerspoon ...
Backing up Library/Application Support/Adobe/OOBE ...
Backing up .ipython ...
Backing up Library/Preferences/com.googlecode.iterm2.plist ...
Backing up .config/iterm2/AppSupport/DynamicProfiles ...
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.37', 'console_scripts', 'mackup')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/application.py", line 119, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/sacpjk/Library/CloudStorage/Dropbox/Mackup/.config/iterm2/AppSupport/DynamicProfiles' -> '/Users/sacpjk/.config/iterm2/AppSupport/DynamicProfiles'
@atahani
Copy link

atahani commented Jun 16, 2023

same issue on arm64

ProductName:		macOS
ProductVersion:		13.4
BuildVersion:		22F66
brew info mackup
==> mackup: stable 0.8.37 (bottled), HEAD
Keep your Mac's application settings in sync
https://github.com/lra/mackup
/opt/homebrew/Cellar/mackup/0.8.37 (1,364 files, 10.8MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-06-16 at 10:25:23
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/mackup.rb
License: GPL-3.0-or-later
==> Dependencies
Required: python@3.11 ✔, six ✔
==> Options
--HEAD
	Install HEAD version
==> Analytics
install: 0 (30 days), 0 (90 days), 0 (365 days)
install-on-request: 0 (30 days), 0 (90 days), 0 (365 days)
build-error: 0 (30 days)

@manishie
Copy link

Same exact issue for me...

@jamesrtnz
Copy link

Try this replacement iterm2.cfg; which needs to go into ${HOME}/.mackup (you'll need to create this directory if you don't have one already):

[application]
name = iTerm2

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application Support/iTerm2/DynamicProfiles

The original config tries to backup an iTerm2 directory ${HOME}/.config/iterm2/AppSupport/DynamicProfiles; but on my machine, the parent "AppSupport" is a symlink - the modified config above targets the actual "DynamicProfiles" directory, not the symlinked version.

Would be useful to know if this works for anyone...

@timfee
Copy link
Contributor

timfee commented Jun 29, 2023

No such luck in my case (on iCloud as a destination). I nuked the Mackup App Support directory (/Users/timfee/Library/Mobile Documents/com~apple~CloudDocs/Timtop/config/mackup/Library/Application Support/iTerm2) and re-ran the command.

It re-populate a (non-symlinked) DynamicProfiles folder in CloudDocs.

> mackup backup
Backing up Library/Application Support/iTerm2/DynamicProfiles ...
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.37', 'console_scripts', 'mackup')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/application.py", line 119, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/timfee/Library/Mobile Documents/com~apple~CloudDocs/Timtop/config/mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/timfee/Library/Application Support/iTerm2/DynamicProfiles'

@timfee
Copy link
Contributor

timfee commented Jun 29, 2023

I lied :-)

The file in ~/.mackup must be named iterm2.cfg (mine was just iterm.cfg) for this to work. Thanks!

@manishie
Copy link

Didn't work. 🙁

➜  ~ mackup backup
Backing up Library/Application Support/iTerm2/DynamicProfiles ...
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.37', 'console_scripts', 'mackup')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/application.py", line 119, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/manishie/Dropbox/Mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/manishie/Library/Application Support/iTerm2/DynamicProfiles'
➜  ~ cat .mackup/iterm2.cfg
[application]
name = iTerm2

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application Support/iTerm2/DynamicProfiles
➜  ~

@jamesrtnz
Copy link

@manishie : did you cleanup any existing older iTerm2 backup file(s) from the mackup backup directory like @timfee did?

@timfee : Thanks, I guess I'll raise a PR to get the file updated then....

@taudor
Copy link

taudor commented Jun 30, 2023

Hi,
I still have the same issue, even with the fix (did the cleanup before).

@nFec
Copy link

nFec commented Jul 4, 2023

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application Support/iTerm2/DynamicProfiles

worked for me! thanks.

@ytra
Copy link

ytra commented Jul 11, 2023

I ran into the same issue. The tips from here did not work for me. After cleaning everything up I thought it wasn't a good idea to run this backup from within a iTerm2 terminal but from the default macOS terminal instead.
There it ran without any problems.

@jamesrtnz
Copy link

Yes; noticed that myself the other day - presumably the iTerm2 software is recreating the directory on the fly; this issue needs more thought.

I'm running the latest 3.5beta myself, FYI.

Also, have noticed that my iTerm2 won't correctly read the symlinked properties file when it's moved to my Cloud Storage; if I backup to a local directory, it's fine. Annoying; and probably not a actual issue with Mackup; but with iTerm2 itself.

@jamesrtnz
Copy link

As mentioned in #1916 , the advice from the iTerm2 authors is to use the native cloud storage facility built into iTerm2; they stated iTerm2 won't work with the way Mackup symlinks the plist files.

@Angboo
Copy link

Angboo commented Sep 12, 2023

This problem also occurred to me. At the same time, I found that a large number of configurations became soft links but did not exist in the backup folder, resulting in the loss of a large number of application configurations, such as git's .gitconfig and asdf's .toolversion.

At present, it seems that for the backup function, modifying the user's original configuration is not a good idea. When a program error occurs, the original configuration will be lost. This is extremely fatal for both backup software and users.

@zhangxiaoyu2046
Copy link

I gave up. After trying all the above methods, my iterm2 is still losing the preference and profile config.
Now I just mackup uninstall and my iterm2 profile came back finally.
I think this fatal bug makes a lot of people give up using mackup, and really hope this issue can be fixed in some later versions.

@timfee
Copy link
Contributor

timfee commented Dec 29, 2023

Ditto - this is why I gave up

@chenhaitao9527
Copy link

chenhaitao9527 commented Apr 4, 2024

Try this replacement iterm2.cfg; which needs to go into ${HOME}/.mackup (you'll need to create this directory if you don't have one already):

[application]
name = iTerm2

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application Support/iTerm2/DynamicProfiles

The original config tries to backup an iTerm2 directory ${HOME}/.config/iterm2/AppSupport/DynamicProfiles; but on my machine, the parent "AppSupport" is a symlink - the modified config above targets the actual "DynamicProfiles" directory, not the symlinked version.

Would be useful to know if this works for anyone...

Maybe you need to add translation characters(\)

[application]
name = iTerm2

[configuration_files]
Library/Preferences/com.googlecode.iterm2.plist
Library/Application\ Support/iTerm2/DynamicProfiles

@mgdigital
Copy link

Same issue here, abandoning Mackup for now due to this :(

@gaspo53
Copy link

gaspo53 commented May 17, 2024

Same issue here:
Backing up Library/Application Support/BraveSoftware/Brave-Browser/Default/Preferences ... Backing up .config/iterm2/AppSupport/DynamicProfiles ... Traceback (most recent call last): File "/opt/homebrew/bin/mackup", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/homebrew/lib/python3.12/site-packages/mackup/main.py", line 93, in main app.backup() File "/opt/homebrew/lib/python3.12/site-packages/mackup/application.py", line 112, in backup utils.link(mackup_filepath, home_filepath) File "/opt/homebrew/lib/python3.12/site-packages/mackup/utils.py", line 145, in link os.symlink(target, link_to) FileExistsError: [Errno 17] File exists: '/Users/gaspar/Library/Mobile Documents/com~apple~CloudDocs/Mackup/.config/iterm2/AppSupport/DynamicProfiles' -> '/Users/gaspar/.config/iterm2/AppSupport/DynamicProfiles'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests