[Borg] can't open file '/opt/borg-env/bin/borg'

Suite à la mise à jour de mon deuxième serveur vers Debian 11 Bullseye, j’ai des soucis avec Borg.

Mon serveur YunoHost

Matériel: KS-3 chez Kimsufi
Version de YunoHost: 4.4.2.13
J’ai accès à mon serveur : En SSH
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : J’ai tenté l’upgrade vers Debian 11.4

Description du problème

Le service borg est planté.

$ sudo systemctl status borg
● borg.service - Run backup borg
     Loaded: loaded (/etc/systemd/system/borg.service; static)
     Active: failed (Result: exit-code) since Wed 2022-09-21 00:03:03 UTC; 11h ago
TriggeredBy: ● borg.timer
    Process: 5209 ExecStart=/usr/bin/sudo /usr/local/bin/backup-with-borg borg (code=exited, status=1/FAILURE)
   Main PID: 5209 (code=exited, status=1/FAILURE)

Sep 21 00:03:01 simonlefort.be sudo[11895]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/yunohost app setting borg mailalert
Sep 21 00:03:01 simonlefort.be sudo[11895]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Sep 21 00:03:02 simonlefort.be sudo[11895]: pam_unix(sudo:session): session closed for user root
Sep 21 00:03:02 simonlefort.be sudo[11897]:     root : PWD=/ ; USER=root ; COMMAND=/usr/bin/yunohost app setting borg state -v failed
Sep 21 00:03:02 simonlefort.be sudo[11897]: pam_unix(sudo:session): session opened for user root(uid=0) by (uid=0)
Sep 21 00:03:03 simonlefort.be sudo[11897]: pam_unix(sudo:session): session closed for user root
Sep 21 00:03:03 simonlefort.be sudo[5209]: pam_unix(sudo:session): session closed for user root
Sep 21 00:03:03 simonlefort.be systemd[1]: borg.service: Main process exited, code=exited, status=1/FAILURE
Sep 21 00:03:03 simonlefort.be systemd[1]: borg.service: Failed with result 'exit-code'.
Sep 21 00:03:03 simonlefort.be systemd[1]: Failed to start Run backup borg.

$ whereis borg
borg: /usr/local/bin/borg

$ borg --version
/opt/borg-env/bin/python: can't open file '/opt/borg-env/bin/borg': [Errno 2] No such file or directory

Je me demande si le problème ne vient pas de l’environnement python qui aurait été mal reconstruit lors de l’upgrade ( 0024_rebuild_python_venv ). En effet, borg ne semble pas au bon endroit :

$ ls -al /opt/borg-env/bin/
total 52
drwxr-xr-x 2 root root 4096 Sep 19 08:49 .
drwxr-xr-x 6 root root 4096 Sep 19 08:48 ..
-rw-r--r-- 1 root root 1892 Sep 19 08:49 activate
-rw-r--r-- 1 root root  841 Sep 19 08:49 activate.csh
-rw-r--r-- 1 root root 1981 Sep 19 08:49 activate.fish
-rw-r--r-- 1 root root 8834 Sep 19 08:49 Activate.ps1
-rwxr-xr-x 1 root root  238 Sep 19 08:49 easy_install
-rwxr-xr-x 1 root root  238 Sep 19 08:49 easy_install-3.9
-rwxr-xr-x 1 root root  229 Sep 19 08:49 pip
-rwxr-xr-x 1 root root  229 Sep 19 08:49 pip3
-rwxr-xr-x 1 root root  229 Sep 19 08:49 pip3.9
lrwxrwxrwx 1 root root   15 Sep 19 08:48 python -> /usr/bin/python
lrwxrwxrwx 1 root root    6 Sep 19 08:48 python3 -> python
lrwxrwxrwx 1 root root    6 Sep 19 08:48 python3.9 -> python

Sur mon autre server, borg apparait bien dans ce dossier.

Une idée ?

Oui ça semble être ça…

Du coup je tenterais:

sudo yunohost app upgrade borg --force

Je copie ma réponse faite sur l’autre post :


Merci @Aleks, je tente ça !

$ sudo yunohost app upgrade borg --force
Info: Now upgrading borg...
Info: [++..................] > Backing up the app before upgrading (may take a while)...
Info: [##++................] > Ensuring downward compatibility...
Info: [####++..............] > Upgrading dependencies...
Info: [######++............] > Configuring system user...
Info: [########+++.........] > Upgrading borgbackup...
Info: Installing/compiling borg, this may take some time...
Info: [###########++.......] > Setting up backup method...
Warning: File /etc/yunohost/hooks.d/backup_method/05-borg_app has been manually modified since the installation or last upgrade. So it has been duplicated in /var/cache/yunohost/appconfbackup//etc/yunohost/hooks.d/backup_method/05-borg_app.backup.20220928.114626
Warning: --- /var/cache/yunohost/appconfbackup//etc/yunohost/hooks.d/backup_method/05-borg_app.backup.20220928.114626	2022-04-09 13:14:41.033750053 +0000
Warning: +++ /etc/yunohost/hooks.d/backup_method/05-borg_app	2022-09-28 11:46:28.185122380 +0000
Warning: @@ -7,9 +7,9 @@
Warning:  BORG_PASSPHRASE="$(yunohost app setting $app passphrase)"
Warning:  repo="$(yunohost app setting $app repository)"   #$4
Warning:  if ssh-keygen -F "artanux.be" >/dev/null ; then
Warning: -    BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -p 12345 -oStrictHostKeyChecking=yes "
Warning: +    BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=yes "
Warning:  else
Warning: -    BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -p 12345 -oStrictHostKeyChecking=no "
Warning: +    BORG_RSH="ssh -i /root/.ssh/id_${app}_ed25519 -oStrictHostKeyChecking=no "
Warning:  fi
Warning:  do_need_mount() {
Info: [#############++.....] > Upgrading systemd configuration...
Info: [###############++...] > Integrating service in YunoHost...
Info: [####################] > Upgrade of borg completed
Success! borg upgraded
Success! Upgrade complete

(Le port “12345” n’est pas celui que j’utilise.)

$ ls -al /opt/borg-env/bin/
total 56
drwxr-xr-x 2 root root 4096 Sep 28 11:46 .
drwxr-xr-x 6 root root 4096 Sep 28 11:46 ..
-rw-r--r-- 1 root root 1892 Sep 28 11:39 activate
-rw-r--r-- 1 root root  841 Sep 28 11:39 activate.csh
-rw-r--r-- 1 root root 1981 Sep 28 11:39 activate.fish
-rw-r--r-- 1 root root 8834 Sep 28 11:39 Activate.ps1
-rwxr-xr-x 1 root root  220 Sep 28 11:46 borg
-rwxr-xr-x 1 root root  220 Sep 28 11:46 borgfs
-rwxr-xr-x 1 root root  229 Sep 28 11:39 pip
-rwxr-xr-x 1 root root  229 Sep 28 11:39 pip3
-rwxr-xr-x 1 root root  229 Sep 28 11:39 pip3.9
lrwxrwxrwx 1 root root    7 Sep 28 11:39 python -> python3
lrwxrwxrwx 1 root root   16 Sep 28 11:39 python3 -> /usr/bin/python3
lrwxrwxrwx 1 root root    7 Sep 28 11:39 python3.9 -> python3
-rwxr-xr-x 1 root root  216 Sep 28 11:39 wheel

Ça semble bon! Borg est à nouveau au bon emplacement.

J’ai à nouveau rajouté le port dans le bon fichier :

$ sudo vim /etc/yunohost/hooks.d/backup_method/05-borg_app
(...)

Et puis relancer le service:

$ sudo systemctl start borg 

$ sudo systemctl status borg 
● borg.service - Run backup borg
     Loaded: loaded (/etc/systemd/system/borg.service; static)
     Active: inactive (dead) since Wed 2022-09-28 12:07:55 UTC; 2min 32s ago
TriggeredBy: ● borg.timer
    Process: 13686 ExecStart=/usr/bin/sudo /usr/local/bin/backup-with-borg borg (code=exited, status=0/SUCCESS)
   Main PID: 13686 (code=exited, status=0/SUCCESS)

Ça a l’air bon!

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.