borgbackup / homebrew-tap

borgbackup packages for macOS homebrew users
30 stars 8 forks source link

Borgbackup failing after recent update #36

Closed fasmat closed 1 week ago

fasmat commented 1 week ago

Hi, I updated with brew upgrade today with borgbackup-fuse installed. Now when I try to do a backup it fails with the following error:

Sun Nov 10 13:29:06 CET 2024 Starting backup

Traceback (most recent call last):
  File "/opt/homebrew/bin/borg", line 5, in <module>
    from borg.archiver import main
  File "/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/lib/python3.11/site-packages/borg/__init__.py", line 1, in <module>
    from packaging.version import parse as parse_version
ModuleNotFoundError: No module named 'packaging'

any idea what could be the issue? Uninstalling borgbackup-fuse and using borgbackup instead solves the issue, but I would like to keep using fuse to access my backups.

ThomasWaldmann commented 1 week ago

Can confirm:

tw@MacBook-Pro ~ % brew reinstall borgbackup-fuse
==> Fetching borgbackup/tap/borgbackup-fuse
==> Downloading https://files.pythonhosted.org/packages/08/4c/17adf86a8fbb02c144c7569dc4919483c01a2ac270307e2d59e1ce394087/msgpack-1.0.8.tar.gz
Already downloaded: /Users/tw/Library/Caches/Homebrew/downloads/f46e69596a97024415d446818fb84f866d5445b718622c588392d36b27548eb1--msgpack-1.0.8.tar.gz
==> Downloading https://files.pythonhosted.org/packages/46/3a/31fd28064d016a2182584d579e033ec95b809d8e220e74c4af6f0f2e8842/pyparsing-3.1.2.tar.gz
#################################################################################################################################################################### 100.0%
==> Downloading https://files.pythonhosted.org/packages/d2/2c/64f01042d1ed08725342c85ddb48a29d2a4f8712d27f22f66f28a67a079c/llfuse-1.5.0.tar.gz
Already downloaded: /Users/tw/Library/Caches/Homebrew/downloads/ec4aed76961e83c284ba955382b71b8b0f2bce220236efbe2df2268cf79b212a--llfuse-1.5.0.tar.gz
==> Downloading https://files.pythonhosted.org/packages/dd/0d/28e60180ce4ae171adba65ce9f8878fce3580c6d2cfdfa998929175105dd/borgbackup-1.4.0.tar.gz
Already downloaded: /Users/tw/Library/Caches/Homebrew/downloads/b3e9392343c612b64bb780c2ab23bd4430361c16d830a57e8976ff7cd40398d5--borgbackup-1.4.0.tar.gz
==> Reinstalling borgbackup/tap/borgbackup-fuse 
==> python3.11 -m venv --system-site-packages --without-pip /opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec
==> python3.11 -m pip --python=/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/bin/python install /private/tmp/borgbackup-fuse--msgpack-20241110-27844-xt34n2/msgpack-1.
==> python3.11 -m pip --python=/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/bin/python install /private/tmp/borgbackup-fuse--pyparsing-20241110-27844-ivn5w/pyparsing
==> python3.11 -m pip --python=/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/bin/python install /private/tmp/borgbackup-fuse--llfuse-20241110-27844-s5rcze/llfuse-1.5.
==> python3.11 -m pip --python=/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/bin/python install /private/tmp/borgbackup-fuse-20241110-27844-llkeyx/borgbackup-1.4.0
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/borgbackup-fuse/1.4.0: 184 files, 4.7MB, built in 1 minute 35 seconds
==> Running `brew cleanup borgbackup-fuse`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

tw@MacBook-Pro ~ % borg help
Traceback (most recent call last):
  File "/opt/homebrew/bin/borg", line 5, in <module>
    from borg.archiver import main
  File "/opt/homebrew/Cellar/borgbackup-fuse/1.4.0/libexec/lib/python3.11/site-packages/borg/__init__.py", line 1, in <module>
    from packaging.version import parse as parse_version
ModuleNotFoundError: No module named 'packaging'

tw@MacBook-Pro ~ % rehash

tw@MacBook-Pro ~ % which borg
/opt/homebrew/bin/borg
ThomasWaldmann commented 1 week ago

@m3nu Guess we found the reason why vorta on my laptop uses the builtin borg and not the one from homebrew. The installed one from homebrew simply doesn't work.

Bummer, didn't notice that yet - too many borg on this machine. :-)

ThomasWaldmann commented 1 week ago

Interestingly, I also have python-packaging installed from homebrew, but that does not get found by borg.

m3nu commented 1 week ago

I believe homebrew installs each Python package in its own virtual env.

m3nu commented 1 week ago

Coming back to the original issue topic. We can just copy anything that's missing from the official brew: https://github.com/Homebrew/homebrew-core/blob/bd67c3212f5bb063a9b52e6f34a0a9fe4050a183/Formula/b/borgbackup.rb

I can do it tomorrow.

fasmat commented 1 week ago

I added a PR that should fix the issue, at least if installed via the fixed Formula borgbackup-fuse works again on my machine 🙂: https://github.com/borgbackup/homebrew-tap/pull/39

ThomasWaldmann commented 1 week ago

@fasmat can you also check #38?

fasmat commented 1 week ago

Yes pyparsing seems to not actually be needed so I removed it.

I also updated the Github actions workflow to execute brew audit and brew style again.