docker-borgmatic
docker-borgmatic copied to clipboard
borgmatic init fails where borg init succeeds
Hi, I’ve been struggling quite a lot with my ansible scripts until I narrowed down to this one issue: after successful launch of the image/container, any attempt to init the repo with bormatic fails while the equivalent init with borg directly actually works. evidences to demonstrate this: $ sudo docker run --detach --name borgmatic -v /home/debian/backup/mnt/OneDrive:/mnt/source:ro -v /home/debian/backup/borg-repository:/mnt/borg-repository -v /home/debian/backup/borg-rclone:/etc/borgmatic.d/ -v /home/debian/backup/borg-rclone:/root/.config/borg -v /home/debian/backup/borg-rclone:/root/.ssh -v /home/debian/backup/borg-rclone:/root/.cache/borg -e TZ=Europe/Paris ghcr.io/borgmatic-collective/borgmatic $ sudo docker exec -it borgmatic /bin/sh
borgmatic init -e none
/mnt/borg-repository is not a valid repository. Check repo config. /mnt/borg-repository: Error running actions for repository Command '('borg', 'info', '--json', '/mnt/borg-repository')' returned non-zero exit status 15. /etc/borgmatic.d/config.yaml: An error occurred
summary: /etc/borgmatic.d/config.yaml: An error occurred /mnt/borg-repository: Error running actions for repository Command '('borg', 'info', '--json', '/mnt/borg-repository')' returned non-zero exit status 15.
Need some help? https://torsion.org/borgmatic/#issues
borg info /mnt/borg-repository --debug
using builtin fallback logging configuration 33 self tests completed in 1.20 seconds /mnt/borg-repository is not a valid repository. Check repo config. Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/borg/repository.py", line 470, in open with open(os.path.join(self.path, 'config')) as fd: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/mnt/borg-repository/config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/borg/archiver.py", line 5391, in main exit_code = archiver.run(args) ^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/borg/archiver.py", line 5309, in run rc = func(args) ^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/borg/archiver.py", line 176, in wrapper with repository: File "/usr/local/lib/python3.12/site-packages/borg/repository.py", line 217, in enter self.open(self.path, bool(self.exclusive), lock_wait=self.lock_wait, lock=self.do_lock) File "/usr/local/lib/python3.12/site-packages/borg/repository.py", line 474, in open raise self.InvalidRepository(self.path) borg.repository.Repository.InvalidRepository: /mnt/borg-repository is not a valid repository. Check repo config.
Platform: Linux f18dd8d5e0e4 6.1.0-23-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15) x86_64 Linux: Unknown Linux Borg: 1.4.0 Python: CPython 3.12.3 msgpack: 1.0.8 fuse: llfuse 1.5.0 [pyfuse3,llfuse] PID: 374 CWD: / sys.argv: ['/usr/local/bin/borg', 'info', '/mnt/borg-repository', '--debug'] SSH_ORIGINAL_COMMAND: None
borg init -e none /mnt/borg-repository/
borg info /mnt/borg-repository
Repository ID: 9acbdf9faf978c814a3ef2a57f658c056fd34ad5b41eb9c8e926d789aab40576 Location: /mnt/borg-repository Encrypted: No Cache: /root/.cache/borg/9acbdf9faf978c814a3ef2a57f658c056fd34ad5b41eb9c8e926d789aab40576 Security dir: /root/.config/borg/security/9acbdf9faf978c814a3ef2a57f658c056fd34ad5b41eb9c8e926d789aab40576
Original size Compressed size Deduplicated size
All archives: 0 B 0 B 0 B
Unique chunks Total chunks
Chunk index: 0 0
Despite I thus have a workaround, I trust it’s worth reporting this issue for the next guys like me to give it a try. best Christophe