borgbase / vorta

Desktop Backup Client for Borg Backup
https://vorta.borgbase.com
GNU General Public License v3.0
2k stars 132 forks source link

Mac binary cannot connect to borg repo while pip version of Vorta works #1849

Closed hasdf closed 6 months ago

hasdf commented 11 months ago

Description

I'm having problems with the Mac Version of Vorta - installed via brew or the the release from this github page.

After adding the Repository to Vorta, I get the error: Connection closed by remote host. Is borg working on the server?

Same for stable and beta release.

If I copy the borg command to cli --> works If I install Vorta via pip --> works

Any Idea where to start looking?

Best Regards Martin

Reproduction

OS

macOS 14.1 23B74 arm64

Version of Vorta

0.8.12

What did you install Vorta with?

Binary

Version of Borg

1.2.6

Logs

2023-11-12 23:59:50,031 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-12 23:59:50,798 - vorta.keyring.abc - DEBUG - No module named 'secretstorage'
2023-11-12 23:59:50,799 - vorta.keyring.abc - DEBUG - Using VortaDarwinKeyring
2023-11-12 23:59:50,799 - vorta.borg.borg_job - DEBUG - Using VortaDarwinKeyring keyring to store passwords.
2023-11-12 23:59:50,800 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-12 23:59:50,800 - vorta.borg.borg_job - DEBUG - Password not found in primary keyring. Falling back to VortaDBKeyring.
2023-11-12 23:59:50,806 - vorta.borg.borg_job - INFO - Running command /opt/homebrew/bin/borg info --info --json --log-json ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-12 23:59:51,007 - vorta.borg.borg_job - WARNING - Using a pure-python msgpack! This will result in lower performance.
2023-11-12 23:59:51,013 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?
real-yfprojects commented 11 months ago

Maybe some firewall issue or related to the borg version used for each installation method?

m3nu commented 11 months ago

Did you try the latest beta version? https://github.com/borgbase/vorta/releases

m3nu commented 11 months ago

Also, if you have Borg in your PATH, Vorta will use that instead of the built-in one.

hasdf commented 11 months ago

As mentioned, I already tried the beta version. Homebrew binarys are in my PATH. And as you can see in the following logs, vorta always uses the homebrew binary in /opt/homebrew/bin/borg.

Firewall issue is not possible, the Client is on the same subnet without any firewall rules. And pip version works from same client. Command line borg also works. Mac OS Software firewall only applies to incoming traffic.

I have appended logs of all Vorta versions I've tried. Last one working, first two not working. It always uses the same settings from /Users/martin/Library/Application Support/Vorta/settings.db. But the issue is also present for a new installation without settings file. Then I cannot add the repository at all, but with the same error message. I tried the brew and binary version before testing the pip version.

Vorta 0.9.1-beta2 binary - not working

2023-11-22 21:41:21,314 - vorta.keyring.abc - DEBUG - No module named 'secretstorage'
2023-11-22 21:41:21,314 - vorta.keyring.abc - DEBUG - Using VortaDarwinKeyring
2023-11-22 21:41:21,314 - vorta.borg.borg_job - DEBUG - Using VortaDarwinKeyring keyring to store passwords.
2023-11-22 21:41:21,333 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-22 21:41:21,428 - root - DEBUG - Command ipconfig getpacket en0 failed
2023-11-22 21:41:21,445 - root - DEBUG - Command ipconfig getpacket en4 failed
2023-11-22 21:41:21,463 - root - DEBUG - Command ipconfig getpacket en5 failed
2023-11-22 21:41:21,480 - root - DEBUG - Command ipconfig getpacket bridge0 failed
2023-11-22 21:41:21,516 - root - DEBUG - Command ipconfig getpacket en2 failed
2023-11-22 21:41:21,533 - root - DEBUG - Command ipconfig getpacket en3 failed
2023-11-22 21:41:21,543 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2023-11-22 21:41:21,544 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2023-11-22 21:41:21,548 - vorta.borg.borg_job - INFO - Running command /opt/homebrew/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude-from /var/folders/zr/7g316q5j29j9y14dr3kwf51c0000gn/T/tmpsyuxgqms ssh://root@192.168.2.200/mnt/user/MacBorg::Mac-mini-2-2023-11-22-214121 /Users/martin
2023-11-22 21:41:21,704 - vorta.borg.borg_job - WARNING - Using a pure-python msgpack! This will result in lower performance.
2023-11-22 21:41:21,709 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?
2023-11-22 21:41:21,827 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 1
2023-11-22 21:41:21,827 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 1
2023-11-22 21:41:21,827 - vorta.scheduler - DEBUG - Scheduler for profile 1 is disabled.

Vorta 0.8.11 installed via brew - not working

2023-11-22 21:49:07,699 - vorta.keyring.abc - DEBUG - No module named 'secretstorage'
2023-11-22 21:49:07,700 - vorta.keyring.abc - DEBUG - Using VortaDarwinKeyring
2023-11-22 21:49:07,700 - vorta.borg.borg_job - DEBUG - Using VortaDarwinKeyring keyring to store passwords.
2023-11-22 21:49:07,705 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-22 21:49:07,802 - root - DEBUG - Command ipconfig getpacket en0 failed
2023-11-22 21:49:07,812 - root - DEBUG - Command ipconfig getpacket en4 failed
2023-11-22 21:49:07,821 - root - DEBUG - Command ipconfig getpacket en5 failed
2023-11-22 21:49:07,831 - root - DEBUG - Command ipconfig getpacket bridge0 failed
2023-11-22 21:49:07,850 - root - DEBUG - Command ipconfig getpacket en2 failed
2023-11-22 21:49:07,860 - root - DEBUG - Command ipconfig getpacket en3 failed
2023-11-22 21:49:07,862 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2023-11-22 21:49:07,862 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2023-11-22 21:49:07,865 - vorta.borg.borg_job - INFO - Running command /opt/homebrew/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude-from /var/folders/zr/7g316q5j29j9y14dr3kwf51c0000gn/T/tmptciqhlff ssh://root@192.168.2.200/mnt/user/MacBorg::Mac-mini-2.localdomain-2023-11-22-214907 /Users/martin
2023-11-22 21:49:07,991 - vorta.borg.borg_job - WARNING - Using a pure-python msgpack! This will result in lower performance.
2023-11-22 21:49:07,997 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?
2023-11-22 21:49:08,114 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 1
2023-11-22 21:49:08,114 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: 1
2023-11-22 21:49:08,115 - vorta.scheduler - DEBUG - Scheduler for profile 1 is disabled.

Vorta 0.8.12 installed via pip - works like expected, just manually cancelled backup after a few seconds

2023-11-22 21:43:14,096 - vorta.keyring.abc - DEBUG - No module named 'secretstorage'
2023-11-22 21:43:14,096 - vorta.keyring.abc - DEBUG - Using VortaDarwinKeyring
2023-11-22 21:43:14,096 - vorta.borg.borg_job - DEBUG - Using VortaDarwinKeyring keyring to store passwords.
2023-11-22 21:43:14,112 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://root@192.168.2.200/mnt/user/MacBorg
2023-11-22 21:43:14,175 - root - DEBUG - Command ipconfig getpacket en0 failed
2023-11-22 21:43:14,184 - root - DEBUG - Command ipconfig getpacket en4 failed
2023-11-22 21:43:14,193 - root - DEBUG - Command ipconfig getpacket en5 failed
2023-11-22 21:43:14,202 - root - DEBUG - Command ipconfig getpacket bridge0 failed
2023-11-22 21:43:14,220 - root - DEBUG - Command ipconfig getpacket en2 failed
2023-11-22 21:43:14,230 - root - DEBUG - Command ipconfig getpacket en3 failed
2023-11-22 21:43:14,232 - vorta.borg.jobs_manager - DEBUG - Add job for site 1
2023-11-22 21:43:14,232 - vorta.borg.jobs_manager - DEBUG - Start job on site: 1
2023-11-22 21:43:14,236 - vorta.borg.borg_job - INFO - Running command /opt/homebrew/bin/borg create --list --progress --info --log-json --json --filter=AM -C lz4 --exclude-from /var/folders/zr/7g316q5j29j9y14dr3kwf51c0000gn/T/tmp9sf_z_9b ssh://root@192.168.2.200/mnt/user/MacBorg::Mac-mini-2.localdomain-2023-11-22-214314 /Users/martin
2023-11-22 21:43:14,358 - vorta.borg.borg_job - WARNING - Using a pure-python msgpack! This will result in lower performance.
2023-11-22 21:43:16,794 - vorta.borg.borg_job - INFO - Creating archive at "ssh://root@192.168.2.200/mnt/user/MacBorg::Mac-mini-2.localdomain-2023-11-22-214314"
2023-11-22 21:43:24,590 - vorta.borg.borg_job - INFO - Synchronizing chunks cache...
2023-11-22 21:43:24,596 - vorta.borg.borg_job - INFO - Archives: 7, w/ cached Idx: 0, w/ outdated Idx: 0, w/o cached Idx: 7.
2023-11-22 21:43:24,606 - vorta.borg.borg_job - INFO - Fetching and building archive index for Mac-mini-2.local-2023-11-16-220505.checkpoint ...
2023-11-22 21:43:41,027 - vorta.borg.borg_job - DEBUG - Cancel job on site default
2023-11-22 21:43:41,028 - vorta.borg.borg_job - DEBUG - Cancel job on site 1
2023-11-22 21:43:44,030 - vorta.borg.jobs_manager - INFO - Finished cancelling all jobs
m3nu commented 11 months ago

Thanks for the detailed logs. Nothing stands out though. My best guess would be that some Apple security features gets in the way. Like Full disk access? When you run Vorta from the terminal after installing it via Pip, it will run with Terminal privs, else with Vorta privs.

real-yfprojects commented 11 months ago

Could it be ssh related?

hasdf commented 11 months ago

@m3nu both iTerm and Vorta have full disk access. I ran into this problem with the pip version, but the error messages are different. Should not be this issue.

@real-yfprojects I guess not.

Really not any idea where to start looking. Happy to provide more testing. Does anyone use the mac binary without problems?

m3nu commented 11 months ago

I test every mac binary locally first after building it on Github. This is on an Intel mac though, not Arm.

hasdf commented 11 months ago

Ok. I will try on another ARM mac. But it will take until next Weekend.

sn0opy commented 10 months ago

Having the same issue on my M1 Mac. Problem even persists in latest beta. Stable release was installed via homebrew. Latest v0.9.1-beta3 has been installed manually through binary download.

sn0opy commented 10 months ago

so it must be something broken with the borgbackup homebrew formula. With version 1.2.6, it was upgraded to Python 3.12 with a few more changes. I went back to 1.2.5 which fixed the problem for me since I was not even able to run borg manually via the CLI.

The way I worked around the problem:

brew tap-new $USER/local-borgbackup
brew tap homebrew/core
brew extract --version=1.2.5 borgbackup $USER/local-borgbackup
brew install borgbackup@1.2.5
github-actions[bot] commented 6 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 7 days with no activity.