Can't setup borg backup

My YunoHost server

Hardware: old laptop with proxmox
YunoHost version: 11.2.5
I have access to my server : Through SSH
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: I have Tailscale installed (should not interfere)
**If your request is related to an app, specify its name and version:borgserver 1.1.16~ynh30

Description of my issue

Borg backup doesn’t work. It can’t connect to my server.
Searching for the problem, I see that my file authorized_keys in /home/borg/.ssh looks strange, the only line is :

command=“borg serve --storage-quota 30G --restrict-to-repository /home/borg/backup”,no-pty,no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc ssh-ed25519 AAAA*****WpIekjPU root@xxx.fr

It is created by line 73 in this file https://github.com/YunoHost-Apps/borgserver_ynh/blob/master/scripts/install

BTW, there is at least another problem : the $USER/backup directory is not created during install (and borg version is deprecated…)

Thanks for helping :pray:

I have probably been searching in wrong direction as authorized_keys file seems ok.

I installed again both borg server and client. I had an error :

2023-11-04 21:10:52,842: DEBUG - + do_backup /home/yunohost.backup/tmp/auto_conf auto_conf borgcoop@100.90.82.142/~/backup 1114794 ''
2023-11-04 21:10:52,842: DEBUG - + export BORG_PASSPHRASE
2023-11-04 21:10:52,842: DEBUG - + export BORG_RSH
2023-11-04 21:10:52,842: DEBUG - + export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
2023-11-04 21:10:52,842: DEBUG - + BORG_RELOCATED_REPO_ACCESS_IS_OK=yes
2023-11-04 21:10:52,843: DEBUG - + work_dir=/home/yunohost.backup/tmp/auto_conf
2023-11-04 21:10:52,843: DEBUG - + name=auto_conf
2023-11-04 21:10:52,843: DEBUG - + repo=borgcoop@100.90.82.142/~/backup
2023-11-04 21:10:52,843: DEBUG - + size=1114794
2023-11-04 21:10:52,843: DEBUG - + description=
2023-11-04 21:10:52,844: DEBUG - ++ date +%Y-%m-%d_%H:%M
2023-11-04 21:10:52,846: DEBUG - + current_date=2023-11-04_21:10
2023-11-04 21:10:52,846: DEBUG - + pushd /home/yunohost.backup/tmp/auto_conf
2023-11-04 21:10:52,846: DEBUG - /home/yunohost.backup/tmp/auto_conf /etc/yunohost/hooks.d/backup_method
2023-11-04 21:10:52,846: DEBUG - + set +e
2023-11-04 21:10:52,847: DEBUG - + borg init -e repokey borgcoop@100.90.82.142/~/backup
2023-11-04 21:10:53,320: WARNING - The parent path of the repo directory [/home/yunohost.backup/tmp/auto_conf/borgcoop@100.90.82.142/~/backup] does not exist.
2023-11-04 21:10:53,353: DEBUG - + set -e
2023-11-04 21:10:53,353: DEBUG - + log_with_timestamp
2023-11-04 21:10:53,354: DEBUG - + borg create borgcoop@100.90.82.142/~/backup::_auto_conf-2023-11-04_21:10 ./
2023-11-04 21:10:53,355: DEBUG - + tee -a /var/log/backup_borg.err
2023-11-04 21:10:53,360: DEBUG - ++ date +%Y-%m-%d_%H:%M:%S
2023-11-04 21:10:53,364: DEBUG - + sed -e 's/^/[2023-11-04_21:10:53] /'
2023-11-04 21:10:53,918: DEBUG - [2023-11-04_21:10:53] Repository /home/yunohost.backup/tmp/auto_conf/borgcoop@100.90.82.142/~/backup does not exist.
2023-11-04 21:10:54,919: ERROR - Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app

I tried to add a line in the file 05-borg.app to create parent directories, but I still have an error :

2023-11-04 21:45:30,700: DEBUG - + mkdir --parents borgcoop@100.90.82.142/~/backup
2023-11-04 21:45:30,702: DEBUG - + borg init -e repokey borgcoop@100.90.82.142/~/backup
2023-11-04 21:45:31,284: DEBUG - 
2023-11-04 21:45:31,289: WARNING - By default repositories initialized with this version will produce security
2023-11-04 21:45:31,289: WARNING - errors if written to with an older version (up to and including Borg 1.0.8).
2023-11-04 21:45:31,290: DEBUG - 
2023-11-04 21:45:31,290: WARNING - If you want to use these older versions, you can disable the check by running:
2023-11-04 21:45:31,290: WARNING - borg upgrade --disable-tam 'borgcoop@100.90.82.142/~/backup'
2023-11-04 21:45:31,290: DEBUG - 
2023-11-04 21:45:31,290: WARNING - See https://borgbackup.readthedocs.io/en/stable/changes.html#pre-1-0-9-manifest-spoofing-vulnerability for details about the security implications.
2023-11-04 21:45:31,294: DEBUG - 
2023-11-04 21:45:31,295: WARNING - IMPORTANT: you will need both KEY AND PASSPHRASE to access this repo!
2023-11-04 21:45:31,295: WARNING - Use "borg key export" to export the key, optionally in printable format.
2023-11-04 21:45:31,295: WARNING - Write down the passphrase. Store both at safe place(s).
2023-11-04 21:45:31,295: DEBUG - 
2023-11-04 21:45:31,327: DEBUG - + /usr/bin/mail.mailutils -a 'Content-Type: text/plain; charset=UTF-8' -s '[YNH] First backup is starting' root
2023-11-04 21:45:31,328: DEBUG - 
2023-11-04 21:45:31,328: DEBUG - Your first backup on borgcoop@100.90.82.142/~/backup is starting.
2023-11-04 21:45:31,328: DEBUG - 
2023-11-04 21:45:31,328: DEBUG - This is an automated message from your beloved YunoHost server.'
2023-11-04 21:45:31,376: DEBUG - + set -e
2023-11-04 21:45:31,379: DEBUG - + log_with_timestamp
2023-11-04 21:45:31,379: DEBUG - + borg create borgcoop@100.90.82.142/~/backup::_auto_wordpress-2023-11-04_21:45 ./
2023-11-04 21:45:31,383: DEBUG - + tee -a /var/log/backup_borg.err
2023-11-04 21:45:31,390: DEBUG - ++ date +%Y-%m-%d_%H:%M:%S
2023-11-04 21:45:31,397: DEBUG - + sed -e 's/^/[2023-11-04_21:45:31] /'
2023-11-04 21:45:58,907: DEBUG - + popd
2023-11-04 21:45:58,908: DEBUG - /etc/yunohost/hooks.d/backup_method
2023-11-04 21:45:58,908: DEBUG - + log_with_timestamp
2023-11-04 21:45:58,909: DEBUG - + borg prune borgcoop@100.90.82.142/~/backup -P _auto_wordpress- --keep-hourly 2 --keep-daily=7 --keep-weekly=8 --keep-monthly=12
2023-11-04 21:45:58,910: DEBUG - + tee -a /var/log/backup_borg.err
2023-11-04 21:45:58,913: DEBUG - ++ date +%Y-%m-%d_%H:%M:%S
2023-11-04 21:45:58,916: DEBUG - + sed -e 's/^/[2023-11-04_21:45:58] /'
2023-11-04 21:45:59,549: DEBUG - [2023-11-04_21:45:58] Repository /etc/yunohost/hooks.d/backup_method/borgcoop@100.90.82.142/~/backup does not exist.
2023-11-04 21:46:00,550: ERROR - Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 298, in hook_callback
    hook_return = hook_exec(
  File "/usr/lib/python3/dist-packages/yunohost/hook.py", line 410, in hook_exec
    raise YunohostError("hook_exec_failed", path=path)
yunohost.utils.error.YunohostError: Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app

Any help or tips would be really appreciated!

I have spent some time trying to sort this out without success. Only thing I’m sure is that the problem comes from borg server (has anybody been able to install and make it work recently ?)
I have mounted a distant directory with sshfs and it seems to work fine. I will write a blog article for me and whoever it could help.

1 Like

Here is a blog post (in French) explaining the way I have configured my backup :

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