lra / mackup

Keep your application settings in sync (OS X/Linux)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

iTerm2 DynamicProfiles FileExistsError

johanmolen opened this issue ยท comments

Im getting the following error when trying to backup iTerm2 DynamicProfiles:

Backing up Library/Application Support/iTerm2/DynamicProfiles ...
A folder named /Users/username/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles already exists in the backup.
Are you sure that you want to replace it? <Yes|No> Yes
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.35', 'console_scripts', 'mackup')())
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/application.py", line 114, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/username/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/username/Library/Application Support/iTerm2/DynamicProfiles'

Is this a bug or something on my side?

I have the same issue

I have the same issue

It looks like it's related to DynamicProfiles being a directory. Please try this and let us know if it's still failing.

  1. Move DynamicProfiles from your mackup directory to somewhere else as a temporary backup.
  2. Rerun mackup backup (you should no longer see "...already exists in the backup")

Let me know if this works for any of you and we can further investigate the root cause.

@joshmedeski removing the folder with iTerm2 results in the same.

Removing the folder with the terminal app and then run mackup backup works, but once I start iTerm2 again the folder is recreated and I get the same error again.

Hmm, we've run into a similar issue with other apps where the application (i.e. iTerm) overwrites files and mackup loses its symbolic link. I wonder if it's the same kind of issue here.

Is there something I can run to get more debug information?

There is a --verbose flag. Feel free to rerun the command with that flag and let us know if there's any further information given.

Nope no additional info ๐Ÿ‘Ž

Getting the same issue, any fix/work around yet? Moving the Dynamic profile in mackup backup doesn't work

โ•ฐโ”€โฏ mv "/Users/xingfanxia/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles" ~/Downloads
โ•ญโ”€ ๏…น ๏€• ~ ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ๎˜— system ๏€— 02:09:24
โ•ฐโ”€โฏ 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.35', 'console_scripts', 'mackup')())
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/application.py", line 121, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/xingfanxia/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/xingfanxia/Library/Application Support/iTerm2/DynamicProfiles'
โ•ญโ”€ ๏…น ๏€• ~ ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ๎˜— system ๏€— 02:09:26
โ•ฐโ”€โฏ mv '/Users/xingfanxia/Library/Application Support/iTerm2/DynamicProfiles' ~/Downloads
โ•ญโ”€ ๏…น ๏€• ~ ยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยทยท ๎˜— system ๏€— 02:11:52
โ•ฐโ”€โฏ mackup backup
Backing up Library/Preferences/com.googlecode.iterm2.plist ...
Backing up Library/Application Support/iTerm2/DynamicProfiles ...
A folder named /Users/xingfanxia/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles already exists in the backup.
Are you sure that you want to replace it? <Yes|No> Yes
Traceback (most recent call last):
  File "/opt/homebrew/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.35', 'console_scripts', 'mackup')())
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/application.py", line 114, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/opt/homebrew/Cellar/mackup/0.8.35/libexec/lib/python3.10/site-packages/mackup/utils.py", line 145, in link
    os.symlink(target, link_to)
FileExistsError: [Errno 17] File exists: '/Users/xingfanxia/Library/Mobile Documents/com~apple~CloudDocs/Mackup/Library/Application Support/iTerm2/DynamicProfiles' -> '/Users/xingfanxia/Library/Application Support/iTerm2/DynamicProfiles'```

Getting the same problem

Same issue here

Same issue here

Still the same issue in mackup version 0.8.36

@LucasLarson PR fixes this form me ๐Ÿ‘ , thanks

When will be the fix in the master branch?

I updated iterm2.cfg based on #1864, I deleted my iTerm2 backup from my Mackup folder, but when I run mackup backup I get the same error. Anything I'm missing?

commented

Updating my iterm2.cfg based on #1864, I was able to run mackup backup. Would be great to get this released!

@m-roberts @getvega

Updating my iterm2.cfg based on #1864, I was able to run mackup backup. Would be great to get this released!

Where did you modify this file? Where is it located?

commented

Where did you modify this file? Where is it located?

I installed with homebrew, which at time of writing is installing iterm2.cfg into /opt/homebrew/Cellar/mackup/0.8.36/libexec/lib/python3.11/site-packages/mackup/applications. Changing the file directly works (until an update overwrites it again)

I found it by installing and running ag with these 2 commands:

brew install the_silver_searcher
ag -U -g iterm2.cfg $(brew --prefix)

Thanks

A simpler workaround, closing iTerm.app prevent it from recreating DynamicProfiles.
For example, try to backup from Terminal.app or another term:

killall iTerm2
mackup backup

The issue still exists... Any information about when this get updated in the release?

Still experiencing this same issue

commented

I suggest encouraging maintainer to merge in #1864

I'm still getting the iterm2 specific error with latest release of 0.8.37:

Backing up
  /Users/matt/Library/Preferences/com.googlecode.iterm2.plist
  to
  /Users/matt/Library/CloudStorage/GoogleDrive-EMAIL_ADDRESS/My Drive/syncable_apps_mackup/Library/Preferences/com.googlecode.iterm2.plist ...
A file named /Users/matt/Library/CloudStorage/GoogleDrive-EMAIL_ADDRESS/My Drive/syncable_apps_mackup/Library/Preferences/com.googlecode.iterm2.plist already exists in the backup.
Are you sure that you want to replace it? <Yes|No> yes
Backing up
  /Users/matt/.config/iterm2/AppSupport/DynamicProfiles
  to
  /Users/matt/Library/CloudStorage/GoogleDrive-EMAIL_ADDRESS/My Drive/syncable_apps_mackup/.config/iterm2/AppSupport/DynamicProfiles ...
A folder named /Users/matt/Library/CloudStorage/GoogleDrive-EMAIL_ADDRESS/My Drive/syncable_apps_mackup/.config/iterm2/AppSupport/DynamicProfiles already exists in the backup.
Are you sure that you want to replace it? <Yes|No> yes
Traceback (most recent call last):
  File "/usr/local/bin/mackup", line 33, in <module>
    sys.exit(load_entry_point('mackup==0.8.37', 'console_scripts', 'mackup')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/main.py", line 93, in main
    app.backup()
  File "/usr/local/Cellar/mackup/0.8.37/libexec/lib/python3.11/site-packages/mackup/application.py", line 112, in backup
    utils.link(mackup_filepath, home_filepath)
  File "/usr/local/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/matt/Library/CloudStorage/GoogleDrive-EMAIL_ADDRESS/My Drive/syncable_apps_mackup/.config/iterm2/AppSupport/DynamicProfiles' -> '/Users/matt/.config/iterm2/AppSupport/DynamicProfiles'

I'm still getting the iterm2 specific error with latest release of 0.8.37:

same issue here .
Perhaps related to the default settings of iTerm2:

default settings

The issue still persists on the latest release from homebrew. Run into some troubles with iTerm because of it.

I'm getting the same problem on a different computer; confirmed the 1864 update in my version.

Backing up .config/iterm2/AppSupport/DynamicProfiles ...
A folder named /Users/me/backup/Mackup/.config/iterm2/AppSupport/DynamicProfiles already exists in the backup.
Are you sure that you want to replace it? <Yes|No> y
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 112, 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/me/backup/Mackup/.config/iterm2/AppSupport/DynamicProfiles' -> '/Users/me/.config/iterm2/AppSupport/DynamicProfiles'

I also encountered the same issue. Following the earlier guidance, I switched from using iTerm2 to the built-in Terminal in macOS, and now everything is functioning correctly.