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

Cannot init new repository - ERROR - Connection closed by remote host. Is borg working on the server? #1997

Closed
2 tasks done
chodaprog opened this issue May 1, 2024 · 5 comments
Labels
status:stale This item will be closed soon due to inactivity

Comments

@chodaprog
Copy link

chodaprog commented May 1, 2024

Description

I’m trying to init a new repo, but keep getting this error « ERROR : Connection closed by remote host ».
I checked your website : https://docs.borgbase.com/faq/#all-connections-to-a-borgbase-repo-fail-with-an-error-immediately

if I use ssh -v XXXXXX@XXXXXX.repo.borgbase.com, everything works like a charm, including passing the password prompt.

I’ve tried to regenerate many times the ssh key, or create new repos, without success.
My SSH pub key has been added to the « SSH keys » tab in borgbase, and full access permission granted to this very ssh key.

I’m using vorta v0.91, on a MacOS 13.6.1.

ERRORS

In Vorta
vorta

Steps to reproduce

  1. Clear all SSH keys and existing repositories on borgbase.com
  2. Generate new ssh key on my computer id_rsa_borg
  3. Add new SSH key to borgbase.com/ssh and paste the content of id_rsa_borg.pub to the field
  4. Create a new repo in borgbase.com
  5. Grant full access to the newly added SSH keyto this repo
  6. Copy the repo's address (format ssh://XXXXXX@XXXXXX.repo.borgbase.com/./repo)
  7. In Vorta, click on the "+" to add a new repo, paste the repo's address
  8. Paste a new password for the repo and stroke "Add"

Reproduction

  • I tried to reproduce the issue.
  • I was able to reproduce the issue.

OS

MacOS 13.6.1

Version of Vorta

0.91

What did you install Vorta with?

Distribution package

Version of Borg

1.2.7

Logs

2024-05-01 13:12:03,172 - vorta.keyring.abc - DEBUG - No module named 'secretstorage'
2024-05-01 13:12:03,172 - vorta.keyring.abc - DEBUG - Using VortaDarwinKeyring
2024-05-01 13:12:03,172 - vorta.borg.borg_job - DEBUG - Using VortaDarwinKeyring keyring to store passwords.
2024-05-01 13:12:03,174 - vorta.keyring.darwin - DEBUG - Retrieved password for repo ssh://XXXXXXXX@XXXXXXXX.repo.borgbase.com/./repo
2024-05-01 13:12:03,174 - vorta.borg.borg_job - DEBUG - Password not found in primary keyring. Falling back to VortaDBKeyring.
2024-05-01 13:12:03,175 - vorta.borg.jobs_manager - DEBUG - Add job for site default
2024-05-01 13:12:03,176 - vorta.borg.jobs_manager - DEBUG - Start job on site: default
2024-05-01 13:12:03,185 - vorta.borg.borg_job - INFO - Running command /Applications/Vorta.app/Contents/Resources/borg-dir/borg.exe init --info --log-json --encryption=repokey-blake2 ssh://XXXXXXXX@XXXXXXXX.repo.borgbase.com/./repo
2024-05-01 13:12:04,761 - vorta.borg.borg_job - WARNING - Remote: ssh_askpass: exec(/usr/X11R6/bin/ssh-askpass): No such file or directory
2024-05-01 13:12:04,764 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?
2024-05-01 13:12:04,920 - vorta.borg.jobs_manager - DEBUG - Finish job for site: default
2024-05-01 13:12:04,923 - vorta.borg.jobs_manager - DEBUG - No more jobs for site: default
@spiccinini
Copy link

spiccinini commented May 21, 2024

I am having the same issue but with flatpak in linux.
From the logs:

2024-05-20 21:20:40,480 - vorta.borg.borg_job - WARNING - Remote: ssh_askpass: exec(/usr/libexec/ssh-askpass): No such file or directory
2024-05-20 21:20:40,486 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?

Versions:

flatpak list
Name                               Application ID                                 Version           Branch               Installation
Vorta                              com.borgbase.Vorta                             v0.9.1            stable               user
Mesa                               org.freedesktop.Platform.GL.default            24.0.6            23.08                user
Mesa (Extra)                       org.freedesktop.Platform.GL.default            24.0.6            23.08-extra          user
Intel                              org.freedesktop.Platform.VAAPI.Intel                             23.08                user
Breeze GTK theme                   org.gtk.Gtk3theme.Breeze                       6.0.4             3.22                 user
KDE Application Platform           org.kde.Platform                                                 6.6                  user

The vorta installed from the archlinux packages (0.9.1-4) is working without errors with the same profile/server so it is an issue from the flatpack version in my case.

@reinoldus
Copy link

reinoldus commented Jul 7, 2024

I had the same issue on ubuntu 20.04, booting the flatpak-app from the CMD gave me this:

2024-07-07 12:14:26,337 - vorta.borg.borg_job - INFO - Running command /app/bin/borg info --info --json --log-json ssh://xxxxxxxxxxxx/./x/xx
2024-07-07 12:14:26,574 - vorta.borg.borg_job - WARNING - Remote: Bad owner or permissions on /xxx/.ssh/config
2024-07-07 12:14:26,576 - vorta.borg.borg_job - ERROR - Connection closed by remote host. Is borg working on the server?

After changing the permissions on my .ssh/config to 600 it worked. It's a bit weird because the config is not really a sensitive file.

command to start Vorta via CMD:

flatpak run com.borgbase.Vorta

Copy link

github-actions bot commented Oct 6, 2024

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 github-actions bot added the status:stale This item will be closed soon due to inactivity label Oct 6, 2024
@chodaprog
Copy link
Author

chodaprog commented Oct 7, 2024

@reinoldus thank you for your answer. Although, it had no effect on my side.

I went further and addressed two issues mentionned in the debug log :

  • First, I installed the missing keyring library : pip install secretstorage (my vorta was installed via pip, but same occured for dmg binary).

  • Then, I addressed the ssh-askpass mentionned. Scrolling through internet, I saw someone mentionning there were issues with MacOS updates about ssh-askpass. So, I decided to install it and bind it.

  1. sudo port install ssh-askpass
  2. which ssh-askpass gave me the location of the freshly installed exec :

/opt/local/bin/ssh-askpass

  1. Some investigation showed me that /usr/X11 was a symlink

/usr/X11R6 -> ../private/var/select/X11

So I went further and discovered that /private/var/select/ was empty. To bypass this execute sudo mkdir -p /private/var/select/X11/bin to create the missing directory
4. Then, create the symlink sudo ln -s /opt/local/bin/ssh-askpass /usr/X11R6/bin/ssh-askpass

This enables the SSH key password modal to prompt after adding the repository.

Now everything seems in order !

@Dapuva76
Copy link

I'm having the same issue - is chodaprog's post above mine the recommended fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:stale This item will be closed soon due to inactivity
Projects
None yet
Development

No branches or pull requests

4 participants