borgbackup throws error 400 setting up remote repo

  • Hi


    I'm running


    openmediavault-borgbackup 6.1.1

    on

    openmediavault 6.0.12-2


    and followed this nice guide for setting up a remote Borg Backup repo in OMV.


    To authenticate, I generated SSH-keys using OMV > System > Certificates > SSH.


    Connecting to the remote machine using borg in a bash shell with the generated pair of keys as described in the pre-requisites-section of the guide works fine.


    But when I try to setup the remote repo in the plugin, I get the error message:


    400 - Bad request. sharedfolderref: The value null is not a string.


    My guess: Since I am not able to specify which SSH key the Plugin should use for connecting to the remote repo, I guess that might be the underlying problem. Then again I'm new to OMV and don't understand the error message. I have shared folders set up (all of them point to folder paths that contain spaces, but that worked fine so far).


    Can anyone help me please?


    Regards,

    Oliver

    • Offizieller Beitrag

    400 - Bad request. sharedfolderref: The value null is not a string.

    It is a bug in the plugin that only affects the remote repos. I will have to fix.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    6.1.2 is in the repo now. Let me know if that fixes your issue.

  • Thank you! Now saving the settings fails with

    Code
    exit code '2': Remote: Permission denied, please try again. Remote: Permission denied, please try again. Remote: abc@abc.your-storagebox.de: Permission denied (publickey,password). Connection closed by remote host. Is borg working on the server?

    Borg is setup on the server, but how can I specify which private ssh key should be used to connect to the repo? omv-env list only lists OMV_BORGBACKUP_STARTING_HOUR.

    • Offizieller Beitrag

    Borg is setup on the server, but how can I specify which private ssh key should be used to connect to the repo? omv-env list only lists OMV_BORGBACKUP_STARTING_HOUR.

    The plugin doesn't do any of that since it is just using ssh. So, omv root user must have a private key that is an authorized key for the user on the remote host.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.4 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thank you again! I got it to work now. Turns out my Host-entry for the repo-server in /root/.ssh/config wasn't sound. Before fixing it, I tried setting the BORG_RSH environment variable in all sorts of places (/etc/profile.d/borgbackup.sh, /etc/profile, /root/.bashrc), but when borg is run via sudo or the OMV plugin the environment variables specified there don't seem to get set on Debian/Raspberry Pi OS (aarch64). Thank you very much!

  • wadoli

    Hat das Label gelöst hinzugefügt.
  • Thank you again! I got it to work now. Turns out my Host-entry for the repo-server in /root/.ssh/config wasn't sound. Before fixing it, I tried setting the BORG_RSH environment variable in all sorts of places (/etc/profile.d/borgbackup.sh, /etc/profile, /root/.bashrc), but when borg is run via sudo or the OMV plugin the environment variables specified there don't seem to get set on Debian/Raspberry Pi OS (aarch64). Thank you very much!

    Can you explain this a little bit more detailed? As far as I understand, I've got a setup close to yours and got exactly the same error:

    Code
    exit code '2': Remote: Permission denied, please try again.
    Remote: Permission denied, please try again.
    Remote: backup-user@omv6: Permission denied (publickey,password).
    Connection closed by remote host. Is borg working on the server?

    One OMV6 instance is used as a BorgBackup server (I simply installed the BorgBackup plugin version v6.1.2) and another OMV instance (currently running OMV5) should connect as the BorgBackup client.

    I created a pair of ssh keys on OMV5 (System - Certificates - SSH) and copied the public key to the "backup-user" on the OMV6 machine. I did this via "copy"-option in the SSH-Key section (that creates an valid entry in the ~/.ssh/authorized_keys file on the target) and additionally, I copied the pubkey via Clipboard to the "Add public SSH key" section in the user menu.

    I didn't really understand if ryecoaaron 's post above means that this should be sufficient that the BorgBackup Plugin's ssh connection from OMV5 to OMV6 will be established with the newly created certificate's private key. From shell I'm able to establish a connection to the OMV6 server with the newly created private key :

    Code
    root@omv5:/root# ssh -i openmediavault-generatedkey backup-user@omv6
    Last login: Tue May 17 16:33:12 2022 from <IP>
    backup-user@omv6:~$

    So, in General, I hope I may ask a couple of questions in this old thread:

    1. Is it possible to generate a BorgBackup remote repo from OMV5 to OMV6 via plugins or is there a hiccup due to the different plugin versions?
    2. What am I missing? It feels like I'm missing a configuration to tell the BorgBackup plugin to use the correct private key for the connection to the remote repo.
    3. wadoli What do you mean with the Host-entry in your /root/.ssh/config? As far as I understand, there is no need for any additional configuration if you're not using this user/certificate combination for a ssh connection from the client to the server.
    4. Creating the remote repo should be possible without any shared folders, right? I'm using OMV for a couple of years now and I'm familiar with the concept of shared folders, permissions, privileges and ACLs. But I'm new to BorgBackup ;)

    Edit: I'm preparing the backup for the migration from omv 5 to omv 6 on the client machine, that's the reason why I'm still on omv 5 on the client. So I'll hopefully end up in having two omv 6 machines and a working Borg Backup from my local NAS to the offsite NAS.

  • Damned! Every time when you write an entry in the forums, you will find a way to solve this on your own... ||

    The trick is - of course - the /root/.ssh/config. Of course you have to enter the correct keywords in the according Host-section. I simply added the following:

    Code
    Host omv6 omv6.domain.ending <IP>
       IdentityFile /etc/ssh/openmediavault-generatedkey

    Save and enjoy :)

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!