borg_ynh icon indicating copy to clipboard operation
borg_ynh copied to clipboard

Borg not found on the remote host.

Open SimonLefort opened this issue 7 months ago • 3 comments

Describe the bug

I have two servers with Yunohost.

ServerA : Apps and data ServerB : Backups

There are a user "userA" on "ServerB" to use borg serve and receive backups. This user can't use borg so the backup failed.

Context

  • Hardware: Two VPS online
  • YunoHost version: Same for both
# yunohost --version
yunohost: 
  repo: stable
  version: 11.2.22
yunohost-admin: 
  repo: stable
  version: 11.2.7
moulinette: 
  repo: stable
  version: 11.2.1
ssowat: 
  repo: stable
  version: 11.2.1.1
  • I have access to my server: Through SSH and through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Using, or trying to install package version/branch:
root@serverA:~$ yunohost app info borg
description: Regularly create deduplicated, encrypted backups sent to another server using Borg
name: Borg Backup to serverB
version: 1.2.8~ynh2

root@serverB:~$ yunohost app info borgserver
description: Offer backup storage to a friend
name: Borg Server for serverA
version: 1.2.8~ynh1

Steps to reproduce

For example, if I try to see if I am concerned by CVE-2023-36811 :

$ sudo env BORG_RSH="ssh -i /root/.ssh/id_borg_ed25519 -p 22 -oStrictHostKeyChecking=yes " BORG_PASSPHRASE="$(sudo yunohost app setting borg passphrase)" BORG_RELOCATED_REPO_ACCESS_IS_OK=yes BORG_REPO="$(sudo yunohost app setting borg repository)" /var/www/borg/venv/bin/borg upgrade --show-rc --check-tam $BORG_REPO
Remote: bash: line 1: borg: command not found
Connection closed by remote host. Is borg working on the server?
terminating with error status, rc 2

But it's the same if I am connected on serverB with userA and try to execute "borg" :

userA@serverB:~$ borg --help
bash: borg: command not found

userA@serverB:~$ borg="/var/www/borg/venv/bin/borg"

userA@serverB:~$ $borg --help
bash: /var/www/borg/venv/bin/borg: Permission denied

Expected behavior

userA on serverB must access to borg.

Logs

Logs said :

Remote: bash: line 1: borg: command not found

I also write about this problem on the forum : https://forum.yunohost.org/t/borg-borg-pas-dans-le-path/30520

Thanks in advance.

SimonLefort avatar Jul 24 '24 07:07 SimonLefort