Failing to initialize repository using Borg Backup in Synology #605
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#605
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Setup Borg Backup for the first time using Synology guide in BorgBase Docs: https://docs.borgbase.com/setup/synology/
Steps to reproduce
Followed instructions in the guide above with the exception of creating SSH keys using
ssh-keygen -o -a 100 -t ed25519
. If usingssh-keygen -f ./id_synology
, I get a permission error when trying to initialize the repository.SSH into Synology and ran command to initialize repository under Step 6 of the guide above:
Actual behavior
The repository on Borgbase.com shows activity under the event log but still no encryption.
Environment
borgmatic version: [1.6.3]
borgmatic installation method: [Synology Package Center]
Borg version: [1.2.1]
Python version: [3.8.12]
Database version (if applicable): n/a
operating system and version: Synology DSM 7.1.1-42962 Update 2
Thanks for your detailed ticket! Looking at what you've included here, it looks like your user may not have permission to create
/var/services/homes/user/.ssh
, and in fact/var/services/homes/user
may not even exist. Is that possible? Is that the current user's home directory, or some other path? I don't see it listed in your borgmatic configuration file, so that makes me think it's not a configured source directory.Side note: In step 6, the documentation uses out-of-date options. Instead of
--create
, usecreate
. Instead of--prune
, useprune
. And instead of--check
, usecheck
.Yes, it appears that
/var/services/home/user
does not exist when I try to navigate in SSH. I'm not sure if it is the current user's home directory. Will I need to create this folder so that Borg can access it? Am I misunderstanding the purpose of the source directory?The directory listed in my borgmatic configuration file
/volume1/somedatadir
is a "real" test directory I'm hoping to backup.Thanks for clarifying the correct syntax for the options in step 6.
Yeah, the
source_directories
are the directories to backup.I'm not sure where
/var/services/home/user
is coming from (it's not in your configuration file), which is why I speculated it's the current user's home directory. It certainly looks like a home directory. Once you SSH in, you can tryecho $HOME
to get the user's home directory. If it's/var/services/home/user
, then my guess there's a misconfiguration with that user, because their home directory doesn't exist!Thanks for your response. You are correct, my home directory was misconfigured. Upon running
echo $HOME
, I was returnedvar/services/home/user
. There is a setting under Control Panel -> User & Group -> User Home for "Enable user home service". Once I checked that, I ran/usr/local/bin/borgmatic init -e repokey-blake2 -c /volume1/BorgBackup/borgmatic.yml
again, and the output no longer reports errors with the home directory.Unfortunately, I'm still unable to initialize the repository:
Does the "returned non-zero exit status 2" indicate something wrong with my configuration file?
It means Borg itself has returned an error. I'm not sure what's wrong, but it might be this part of the Borg error above: "Repository has no manifest." See https://github.com/borgbackup/borg/issues/5955 for another instance of this happening. One thing you count try is adding
--verbosity 2
on the borgmatic command-line to see if you get any more information about it. Or try deleting and re-adding the repository on the BorgBase side. Or, failing that, contacting the Borg project or BorgBase support. You can also try running aninit
command with Borg directly so as to eliminate borgmatic as the potential cause of this problem.Looks like deleting and re-adding the repository on the BorgBase side fixed it! Maybe it was corrupted at some point when my user profile home directory wasn't properly configured. In any case, thank you very much for your help.
Awesome, I'm glad to hear that did it!