OpenMediaVault-Plugin-Developers / openmediavault-borgbackup

openmediavault plugin for borgbackup
10 stars 5 forks source link

Unable to use the 'skip init' function #43

Closed TheNoMoreHero closed 6 months ago

TheNoMoreHero commented 6 months ago

Hi,

I would like to move my repository to a different HDD. My thought process is to create a new shared folder in the OMV GUI, and use that folder to create a new repository using the 'Skip init' toggle to import the old repository in BorgBackup. When I enable the 'Skip init' toggle, I get the following 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=REDACTED; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg info '/srv/dev-disk-by-uuid-f3cb31f7-3415-4e21-9753-47ce84634bfa/Backup2/' 2>&1' with exit code '2': /srv/dev-disk-by-uuid-f3cb31f7-3415-4e21-9753-47ce84634bfa/Backup2 is not a valid repository. Check repo config.

OMV\ExecException: 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=REDACTED; export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes; export BORG_RELOCATED_REPO_ACCESS_IS_OK=yes; /usr/bin/borg info '/srv/dev-disk-by-uuid-f3cb31f7-3415-4e21-9753-47ce84634bfa/Backup2/' 2>&1' with exit code '2': /srv/dev-disk-by-uuid-f3cb31f7-3415-4e21-9753-47ce84634bfa/Backup2 is not a valid repository. Check repo config. in /usr/share/php/openmediavault/system/process.inc:242
Stack trace:
#0 /usr/share/openmediavault/engined/rpc/borgbackup.inc(188): OMV\System\Process->execute(Array, 2)
#1 [internal function]: OMVRpcServiceBorgBackup->setRepo(Array, Array)
#2 /usr/share/php/openmediavault/rpc/serviceabstract.inc(123): call_user_func_array(Array, Array)
#3 /usr/share/php/openmediavault/rpc/rpc.inc(86): OMV\Rpc\ServiceAbstract->callMethod('setRepo', Array, Array)
#4 /usr/sbin/omv-engined(537): OMV\Rpc\Rpc::call('BorgBackup', 'setRepo', Array, Array, 1)
#5 {main}

Just to be clear: The repository does create when I leave the 'skip init' disabled.

Am I doing anything wrong?

ryecoaaron commented 6 months ago

There really isn't a good way to do this with the plugin. I am working on adding a feature that would help with this.

TheNoMoreHero commented 6 months ago

Thanks for getting back. The fact that it throws an error is still undesired though right? Or would this be fixed in your new feature?

ryecoaaron commented 6 months ago

No, it isn't an error in the code. When you skip the init, the plugin still runs a borg info command against the repo to verify there is a repo in the specified location. If there isn't a repo there, the plugin throws an error by design. I plan to add a feature allowing an existing repo's path to be changed.

TheNoMoreHero commented 6 months ago

I see, thanks for the information!

ryecoaaron commented 6 months ago

I am still working on the feature allowing you to move a repo.

ryecoaaron commented 6 months ago

Took a while since I was on vacation but here is the change https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-borgbackup/commit/ff45f07f57d754a15fb8c3bd80ee6ef004c1cb86

I am still testing but it should be released soon.

TheNoMoreHero commented 5 months ago

Hi! How can I see/track if it has been released on OMV6? I recently tried it, but couldn't get it to work

ryecoaaron commented 5 months ago

It is OMV 7 only. OMV 7 has been released as well.

TheNoMoreHero commented 4 months ago

Ah, perfect. Last time I checked it hadn´t yet, but then I'll upgrade and try the feature. Thanks for your work!