Open KvL159 opened 3 years ago
Here is some update on the issue :
$ borg
-bash: borg: command not found
I then tried to run the script manually :
$ cd /usr/local/bin
$ backup-with-borg
ls: cannot access '/etc/yunohost/hooks.d/backup/': No such file or directory
Info: Creating a backup archive from the collected files...
Warning: do_known_hosts: hostkeys_foreach failed: No such file or directory
Warning: do_known_hosts: hostkeys_foreach failed: No such file or directory
Error: Could not run script: /etc/yunohost/hooks.d/backup_method/05-borg_app
Error: Custom backup method could not get past the 'backup' step
It seems related to this issue, however I'm not sure if it was solved : https://forum.yunohost.org/t/borg-backup-sauvegarde-locale/12496/3
@zamentur Thank you for your help
I am still not able to run Borg on any of my servers, any hint where could be the issue ?
I get the same error as you do
nov. 04 22:39:14 xx backup-with-borg[25707]: Échec de l’exécution du script : /etc/yunohost/hooks.d/backup_method/05-borg_app nov. 04 22:39:14 xx backup-with-borg[25707]: Échec de la méthode de sauvegarde personnalisée à l’étape 'backup' nov. 04 22:39:14 xx systemd[1]: borg.service: Main process exited, code=exited, status=1/FAILURE nov. 04 22:39:14 xx systemd[1]: borg.service: Failed with result 'exit-code'. nov. 04 22:39:14 x systemd[1]: Failed to start Run backup borg.
It seems like borg is not very easy to handle...
borg init: error: argument REPOSITORY: Invalid location format: "ssh://ok5v04j1@ok5v04j1.repo.borgbase.com:repo/~/backup"
There's at least two problems. First, SSH connection was failing, even though the script points to /root/.ssh/id_borg_ed25519. Got around that by adding to /root/.ssh/config:
Host *.repo.borgbase.com
IdentityFile ~/.ssh/id_borg_ed25519
That could just be from testing from command line and not from script and missing the variables, though. Won't hurt to add.
Second, I was getting borg init errors, and needed to remove the "ssh://" at the start of the repo.
Then I was getting this error: [2020-12-01_03:36:24] Repository path not allowed: /srv/repos/ok5v04j1/repo/~/backup
borg list ok5v04j1@ok5v04j1.repo.borgbase.com:repo
prints the files.
borg list ok5v04j1@ok5v04j1.repo.borgbase.com:repo/~/backup
gives:
Repository path not allowed: /srv/repos/ok5v04j1/repo/~/backup
So from my notes, I seem to have removed the ~/backup from the repo path as well, and now when I run the backup, the error log contains:
[2020-12-01_03:44:52] A repository already exists at ok5v04j1@ok5v04j1.repo.borgbase.com:repo.
IIRC, this always happened and can be ignored. But for the first time since upgrading to Debian 10, borgbase shows an updated modified time, so the repo is currently getting written to.
Change: borg_ynh/conf/backup_method.j2 (in repo) or 05-borg_app (on your server)
repo=ssh://{{ ssh_user }}@{{ server }}/~/backup
to:
repo={{ ssh_user }}@{{ server }}
@KvL159 @Thatoo
ls: cannot access '/etc/yunohost/hooks.d/backup/': No such file or directory
Fix this with:
mkdir -p /etc/yunohost/hooks.d/backup
Then, to fix backup, do you recall if you previously edited the repo to remove the "ssh://" and the "/~/backup"?
See my comment above.
I tried to setup Borg following the instructions provided, however it keeps failing. Setup: Yunohost 4.0.8 Buster, tested on 2 servers (same results) : 1 upgraded from Yunohost 3.X and 1 fresh installed 4.X
At first, the install ran into some issues, the package Cython (pip) was missing, I was able to solve this issue by installing it manually, however would it be possible to fix it in the ynh package ?
Here are the details regarding Borg not working using the following command:
$ sudo yunohost app install borgserver
Here is the log from journal :
The service status :
And the error log from borg :
It seems that the borg command isn't working as well, any idea where could be the issue ?