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

iTerm2 DynamicProfiles FileExistsError #1855

Closed
johanmolen opened this issue Sep 1, 2022 · 31 comments · Fixed by #1864
Closed

iTerm2 DynamicProfiles FileExistsError #1855

johanmolen opened this issue Sep 1, 2022 · 31 comments · Fixed by #1864

Comments

@johanmolen
Copy link

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?

@fharper
Copy link
Contributor

fharper commented Sep 2, 2022

I have the same issue

1 similar comment
@steveshi
Copy link

steveshi commented Sep 6, 2022

I have the same issue

@joshmedeski
Copy link
Contributor

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.

@johanmolen
Copy link
Author

@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.

@johanmolen
Copy link
Author

The recreation is normal as listed here:
https://iterm2.com/documentation-dynamic-profiles.html

@joshmedeski
Copy link
Contributor

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.

@johanmolen
Copy link
Author

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

@joshmedeski
Copy link
Contributor

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.

@johanmolen
Copy link
Author

Nope no additional info 👎

@xingfanxia
Copy link

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

@xingfanxia
Copy link

╰─❯ 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'```

@scottmc42
Copy link

Getting the same problem

LucasLarson added a commit to LucasLarson/mackup that referenced this issue Sep 30, 2022
iTerm2’s `DynamicProfiles` content can be saved without error, but only
if loaded from `$XDG_CONFIG_HOME/iterm2/AppSupport/DynamicProfiles`
instead of from `~/Library/Application Support/iTerm2/DynamicProfiles`.
Because this pull request will prevent new errors in backing up
`DynamicProfiles`, it should considered to fix lra#1855.

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
@Fossil01
Copy link

Fossil01 commented Oct 4, 2022

Same issue here

1 similar comment
@ralts00
Copy link

ralts00 commented Oct 6, 2022

Same issue here

@gxcodes
Copy link

gxcodes commented Oct 14, 2022

Still the same issue in mackup version 0.8.36

@getvega
Copy link

getvega commented Oct 14, 2022

@LucasLarson PR fixes this form me 👍 , thanks

LucasLarson added a commit to LucasLarson/mackup that referenced this issue Oct 19, 2022
…ra#1864)

* master:
  Fix lunarVim config path (lra#1870)
  Mackup 0.8.36
  Add support for LunarVim (lra#1869)
  Add support for Airflow (lra#1867)
  Add support for Sizzy (lra#1862)
  Update README.md (lra#1866)
  Add IntelliJ 2022 configuration references (lra#1865)

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
@SDJeff
Copy link

SDJeff commented Oct 26, 2022

When will be the fix in the master branch?

@fharper
Copy link
Contributor

fharper commented Oct 26, 2022

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?

@m-roberts
Copy link

m-roberts commented Oct 31, 2022

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

LucasLarson added a commit to LucasLarson/mackup that referenced this issue Oct 31, 2022
…a#1864)

* origin/master:
  Change style for MD029 from one to ordered (lra#1872)
  Fix typo (lra#1871)

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
@PierBJX
Copy link

PierBJX commented Nov 17, 2022

@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?

@m-roberts
Copy link

m-roberts commented Nov 17, 2022

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)

@PierBJX
Copy link

PierBJX commented Nov 17, 2022

Thanks

@itoumlilt
Copy link

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

@vordenken
Copy link

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

@ilium007
Copy link

ilium007 commented Feb 4, 2023

Still experiencing this same issue

@m-roberts
Copy link

I suggest encouraging maintainer to merge in #1864

@lra lra closed this as completed in #1864 Mar 24, 2023
lra added a commit that referenced this issue Mar 24, 2023
* store `DynamicProfiles` from `$XDG_CONFIG_HOME` (#1855)

iTerm2’s `DynamicProfiles` content can be saved without error, but only
if loaded from `$XDG_CONFIG_HOME/iterm2/AppSupport/DynamicProfiles`
instead of from `~/Library/Application Support/iTerm2/DynamicProfiles`.
Because this pull request will prevent new errors in backing up
`DynamicProfiles`, it should considered to fix #1855.

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>

* Add support for Logseq (#1876)

* Add support for Logseq in README

* Update CHANGELOG.md

* Add files via upload

* Add support for PrusaSlicer (#1874)

* Add support for PrusaSlicer

* Add support for PrusaSlicer in README

* Update CHANGELOG.md

* add newline

Co-authored-by: Laurent Raufaste <analogue@glop.org>

---------

Signed-off-by: Lucas Larson <LucasLarson@riseup.net>
Co-authored-by: Mariano Mollo <marianomollo@protonmail.ch>
Co-authored-by: Laurent Raufaste <analogue@glop.org>
@elmpp
Copy link

elmpp commented Apr 1, 2023

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'

@liaozihang
Copy link

liaozihang commented Apr 15, 2023

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

@Jendker
Copy link

Jendker commented May 11, 2023

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

@scottmc42
Copy link

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'

@davidwang558
Copy link

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.

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

Successfully merging a pull request may close this issue.