Unable to create/connect Borg-Backup repo.

  • I am trying to set up encrypted remote backups of my NAS but i am unable to get a repo connected via Borg backup.


    I allready tried adding the keys via OMV-Gui and also did add the key to Borg using the: export BORG_RSH='ssh -i /etc/ssh/my_secure_server_key' command and still i am getting the error message:


    500 - Internal Server Error Failed to execute command 'export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin; export LANG=C.UTF-8; export LANGUAGE=; export BORG_PASSPHRASE='somepassphrase'; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg init --encryption=keyfile 'ssh://user@server.com:23/./backups-folder' 2>&1' with exit code '2': Remote: Permission denied, please try again.
    Remote: Permission denied, please try again.
    Remote: user@server.com: Permission denied (publickey,password).
    Connection closed by remote host. Is borg working on the server?


    Is there some special location i have to put the keys in?

    If someone has a solution i would be very thankful.

    • Official Post

    export BORG_RSH='ssh -i /etc/ssh/my_secure_server_key'

    Executing that command doesn't help the plugin. I am in the middle of making environment variables better (assuming you are on omv 6.x). So, I would wait a day or two for me to have that ready.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • Executing that command doesn't help the plugin. I am in the middle of making environment variables better (assuming you are on omv 6.x). So, I would wait a day or two for me to have that ready.

    Okay, so i saw in the other post you where saying to place the enviroment vairables into /etc/default/openmediavault-borg directory. Is that possible now or in the future version? also how would i do that if it is possible?


    Thanks in advance.

    • Official Post

    Okay, so i saw in the other post you where saying to place the enviroment vairables into /etc/default/openmediavault-borg directory. Is that possible now or in the future version? also how would i do that if it is possible?

    Just install the latest version of the plugin (6.4). There is a Environment Variables tab.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • Just install the latest version of the plugin (6.4). There is a Environment Variables tab.

    First thing, thanks for adding that. But i can only add an variable after i added the repo as a repo is required to be selected when adding an env variable, only problem is that i am because of the variable not able to add the repo, and through that also unable to add the variable.. Any bypass to that or am i missing something?


    Thanks in advance.

    • Official Post

    But i can only add an variable after i added the repo as a repo is required to be selected when adding an env variable, only problem is that i am because of the variable not able to add the repo, and through that also unable to add the variable.. Any bypass to that or am i missing something?

    Unfortunately, I don't have a better way to work that. To create a new repo that requires environment variables, you will have to temporary add them to /etc/default/openmediavault-borgbackup until the repo is created.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • Unfortunately, I don't have a better way to work that. To create a new repo that requires environment variables, you will have to temporary add them to /etc/default/openmediavault-borgbackup until the repo is created.

    So adding the Repo worked, but after adding the variable i cant get repo Info or do anything with the repo, it just gives an empty response..


    • Official Post

    The name should be environment variable name (BORG_RSH from your screenshot) not some random name.


    name=value

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • The name should be environment variable name (BORG_RSH from your screenshot) not some random name.


    name=value

    Thank you very much, but now i have another Problem, the plugin spits out an Exeption. I allready tried giving the file 775 permission that did not work either.

    Code
    Local Exception
    Traceback (most recent call last): File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5159, in main exit_code = archiver.run(args) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 5090, in run return set_ec(func(args)) File "/usr/lib/python3/dist-packages/borg/archiver.py", line 161, in wrapper repository = RemoteRepository(location.omit_archive(), create=create, exclusive=argument(args, exclusive), File "/usr/lib/python3/dist-packages/borg/remote.py", line 562, in __init__ self.p = Popen(borg_cmd, bufsize=0, stdin=PIPE, stdout=PIPE, stderr=PIPE, env=env, preexec_fn=ignore_sigint) File "/usr/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.9/subprocess.py", line 1823, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)
    PermissionError: [Errno 13] Permission denied: '/etc/ssh/openmediavault-123-sshkeyid'
    Platform: Linux nas 5.18.0-0.deb11.4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 5.18.16-1~bpo11+1 (2022-08-12) x86_64
    Linux: Unknown Linux Borg: 1.2.2 Python: CPython 3.9.2 msgpack: 1.0.0 fuse: llfuse 1.3.8 [pyfuse3,llfuse]
    PID: 20726 CWD: /
    sys.argv: ['/usr/bin/borg', 'info', 'ssh://user@server.com:23/./BackupFolder']
    SSH_ORIGINAL_COMMAND: None
    END OF LINE[tt]<span id="selection-marker-1" class="redactor-selection-marker woltlab-bbcode-marker"></span>[/tt]
    • Official Post

    When you start adding variables and using remote repos, it is going to be very hard for people to help without knowing lots of details about both servers. Try using ssh from the command line as root to execute your ssh -i /path/to/key user@server.com:23

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

    • Official Post

    What is the output of: sudo stat /etc/ssh/openmediavault-123-sshkeyid

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • What is the output of: sudo stat /etc/ssh/openmediavault-123-sshkeyid

    The output is:


    sudo stat /etc/ssh/openmediavault-123-sshkeyid


    File: /etc/ssh/openmediavault-123-sshkeyid


    Size: 2459 Blocks: 8 IO Block: 4096 reg

    ular file

    Device: fd01h/64769d Inode: 6031670 Links: 1

    Access: (0600/-rw-------) Uid: ( 775/ UNKNOWN) Gid: ( 0/

    root)

    Access: 2022-10-11 21:57:59.894635206 +0200

    Modify: 2022-10-10 22:28:48.049870598 +0200

    Change: 2022-10-11 21:56:36.673215246 +0200

    Birth: 2022-10-10 22:28:48.049870598 +0200

    • Official Post

    sudo chown root:root /etc/ssh/openmediavault-123-sshkeyid and then try it again.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • sudo chown root:root /etc/ssh/openmediavault-123-sshkeyid and then try it again.

    Allright i did that but it still gives me the Permission denied.


    New stat of the file looks like:


    stat /etc/ssh/openmediavault-openmediavault-123-sshkeyid


    File: /etc/ssh/openmediavault-openmediavault-123-sshkeyid

    Size: 2459 Blocks: 8 IO Block: 4096 regular file

    Device: fd01h/64769d Inode: 6031670 Links: 1

    Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)

    Access: 2022-10-11 21:57:59.894635206 +0200

    Modify: 2022-10-10 22:28:48.049870598 +0200

    Change: 2022-10-12 20:04:55.047009757 +0200

    Birth: 2022-10-10 22:28:48.049870598 +0200

    • Official Post

    What if you chmod 644 the file?

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

    • Official Post

    6.4.1 in the repo. This allows you to create environment variables for repo creation by selecting "Repo creation" for the repo.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • 6.4.1 in the repo. This allows you to create environment variables for repo creation by selecting "Repo creation" for the repo.

    Chmod 664 did not fix it.

    And i am unable to delete the old enviroment variable, it throws out an error 500:


    500 - Internal Server Error Failed to execute XPath query '//services/borgbackup/repos/repo[uuid='123-123-123-123-123']'.

    • Official Post

    And i am unable to delete the old enviroment variable, it throws out an error 500:

    I need to fire my tester (me) : ) 6.4.2 is in the repo.


    Chmod 664 did not fix it.

    I'm not sure what else it could be. I haven't used remote repos like this hardly at all.

    omv 8.0.10-2 synchrony | 6.17 proxmox kernel

    plugins :: omvextrasorg 8.0.2 | kvm 8.0.5 | compose 8.1.3 | cterm 8.0 | borgbackup 8.1.4 | cputemp 8.0 | mergerfs 8.0 | scripts 8.0.1 | writecache 8.1


    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!

  • I need to fire my tester (me) : ) 6.4.2 is in the repo.


    I'm not sure what else it could be. I haven't used remote repos like this hardly at all.

    So, deleting the Enviroment variables is working now.


    The strange thing is it worked first when puting the variable in /etc/default/openmediavault-borg.

    (now that doesnt work anymore)


    Is it important that i dont use the default user and made a new with sudo and omv-admin groups?


    Could the cause be that i add the keys by using nano /etc/ssh/keyname ?

    I haven't used remote repos like this hardly at all.

    What exactly do you mean by that?


    And could it play a role that the key is in /etc/ directory? should i put it in a different one?


    How do you put the keys on the server? Via OMV-Gui ( System > Certificates > SSH), via manually pasting them in the file? or via generating them on the NAS first?


    I want to get my backups working finally so i can start using my nas..

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!