extract to a destination with a relative path is broken #1280

Closed
opened 2026-03-02 18:45:01 +00:00 by cwren · 5 comments

What I'm trying to do and why

Took an update to the SynoCommunity borg package and my test extract with a relative path failed. The update bumped borgmatic from 2.0.12 to 2.1.2, borg was already at 1.4.3.

Steps to reproduce

take the update with this changelist

from:

Version 1.4.3-20

  1. Update Borg to v1.4.3.
  2. Update borgmatic to v2.0.12.
  3. Refresh Python dependencies.
    Date
    2025-12-11 16:00:26

to:

Version 1.4.3-21

  1. Update borgmatic to v2.1.2.
  2. Refresh Python dependencies.
    Date
    2026-02-13 10:07:44
$ mkdir test
$ borgmatic -v 2 -c borgmatic.yaml extract --archive  "[redacted]" --path [redacted] --destination test 
$ ls test 
[empty result]

Actual behavior

The destination directory specified by --destination is empty

using -v 2 on the extract command, the output lists the requested file, but no output is created in the folder specified by --destination

The tail of the debug outlook looks like this:

TAM-verified archive
[RECOVERED FILE NAME REDACTED]
RemoteRepository: 376.54 kB bytes sent, 148.85 MB bytes received, 7111 messages sent
terminating with success status, rc 0

summary:
/volume1/borg/borgmatic.yaml: Loading configuration file
/volume1/borg/borgmatic.yaml: Successfully ran configuration file

Expected behavior

The extracted files should appear in the destination directory

Other notes / implementation ideas

  • extract without a destination flag does correctly extract to the current working directory
  • extract with a fully qualified destination path does correctly extract the file to the test directory:
$ mkdir test
$ borgmatic -v 2 -c borgmatic.yaml extract --archive  "[redacted]" --path [redacted] --destination $(pwd)/test 

borgmatic version

2.1.2

borgmatic installation method

synology package

Borg version

borg 1.4.3

Python version

Python 3.8.15

Database version (if applicable)

No response

Operating system and version

DSM 7.3.2

### What I'm trying to do and why Took an update to the SynoCommunity borg package and my test extract with a relative path failed. The update bumped borgmatic from 2.0.12 to 2.1.2, borg was already at 1.4.3. ### Steps to reproduce take the update with this [changelist](https://synocommunity.com/package/borgbackup) from: > Version 1.4.3-20 > 1. Update Borg to v1.4.3. > 2. Update borgmatic to v2.0.12. > 3. Refresh Python dependencies. > Date > 2025-12-11 16:00:26 to: > Version 1.4.3-21 > 1. Update borgmatic to v2.1.2. > 2. Refresh Python dependencies. > Date > 2026-02-13 10:07:44 ``` $ mkdir test $ borgmatic -v 2 -c borgmatic.yaml extract --archive "[redacted]" --path [redacted] --destination test $ ls test [empty result] ``` ### Actual behavior The destination directory specified by `--destination` is empty using `-v 2` on the extract command, the output lists the requested file, but no output is created in the folder specified by `--destination` The tail of the debug outlook looks like this: ``` TAM-verified archive [RECOVERED FILE NAME REDACTED] RemoteRepository: 376.54 kB bytes sent, 148.85 MB bytes received, 7111 messages sent terminating with success status, rc 0 summary: /volume1/borg/borgmatic.yaml: Loading configuration file /volume1/borg/borgmatic.yaml: Successfully ran configuration file ``` ### Expected behavior The extracted files should appear in the destination directory ### Other notes / implementation ideas - extract without a destination flag **does** correctly extract to the current working directory - extract with a **fully qualified** destination path **does** correctly extract the file to the test directory: ``` $ mkdir test $ borgmatic -v 2 -c borgmatic.yaml extract --archive "[redacted]" --path [redacted] --destination $(pwd)/test ``` ### borgmatic version 2.1.2 ### borgmatic installation method synology package ### Borg version borg 1.4.3 ### Python version Python 3.8.15 ### Database version (if applicable) _No response_ ### Operating system and version DSM 7.3.2
Owner

I can't seem to repro this on my end. Can you provide more details about:

  • Your borgmatic configuration (redacted as necessary)
  • Full borgmatic logs from when you run extract without getting the expected file (redacted as necessary)

Alternatively, if you can create and share a minimal repro starting from example config and a fresh repo, that could work too.

I can't seem to repro this on my end. Can you provide more details about: - Your borgmatic configuration (redacted as necessary) - Full borgmatic logs from when you run `extract` without getting the expected file (redacted as necessary) Alternatively, if you can create and share a minimal repro starting from example config and a fresh repo, that could work too.
Author

thank you for looking into this so quickly!

config:

constants:
    base: /volume1/borg
source_directories:
    - /volume1/xxxxxx
    - /volume1/yyyyyy/xxxxxx
    - /volume1/zzzzzz
repositories:
    - path: ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg
      label: rsyncnet
      encryption: keyfile
      storage_quota: 2T
      make_parent_directories: true
working_directory: "{base}"
one_file_system: true
remote_path: /usr/local/bin/borg1
encryption_passphrase: "xxxxxx"
upload_rate_limit: 50000
ssh_command: ssh -i {base}/xxxxxx
borg_base_directory: "{base}"
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
keep_yearly: 5

log:

$ /usr/local/bin/borgmatic -v 2 -c /volume1/borg/borgmatic.yaml extract --archive  "xxxxxx-2026-03-01T02:11:20.052779" --path volume1/xxxxxx/yyyy.gz --destination test 
/volume1/borg/borgmatic.yaml: PGDATA=*** BORG_BASE_DIR=*** BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_DEBUG_PASSPHRASE=*** BORG_DISPLAY_PASSPHRASE=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_USE_CHUNKS_ARCHIVE=*** BORG_EXIT_CODES=*** borg --version --log-json --debug --show-rc
/volume1/borg/borgmatic.yaml: Borg 1.4.3
rsyncnet: Running actions for repository
rsyncnet: Extracting archive xxxxxx-2026-03-01T02:11:20.052779
rsyncnet: PGDATA=*** BORG_BASE_DIR=*** BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_DEBUG_PASSPHRASE=*** BORG_DISPLAY_PASSPHRASE=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_USE_CHUNKS_ARCHIVE=*** BORG_EXIT_CODES=*** borg extract --remote-path /usr/local/bin/borg1 --log-json --debug --list --show-rc ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg::xxxxxx-2026-03-01T02:11:20.052779 volume1/xxxxxx/yyyy.gz
using builtin fallback logging configuration
33 self tests completed in 0.32 seconds
SSH command line: ['ssh', '-i', '/volume1/borg/id_synology', 'xxxxxx@xxxxxx.rsync.net', '/usr/local/bin/borg1', 'serve', '--debug']
Remote: using builtin fallback logging configuration
Remote: borg selftest disabled via BORG_SELFTEST env variable
Remote: using builtin fallback logging configuration
Remote: Initialized logging system for JSON-based protocol
Remote: Resolving repository path b'/data2/home/xxxxxx/borg'
Remote: Resolved repository path to '/data2/home/xxxxxx/borg'
Remote: Verified integrity of /data2/home/xxxxxx/borg/index.3405
TAM-verified manifest
security: read previous location 'ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg'
security: read manifest timestamp '2026-03-01T07:27:38.537015'
security: determined newest manifest timestamp as 2026-03-01T07:27:38.537015
security: repository checks ok, allowing access
Archive authentication DISABLED.
TAM-verified archive
volume1/xxxxxx/yyyy.gz
RemoteRepository: 376.54 kB bytes sent, 148.85 MB bytes received, 7111 messages sent
terminating with success status, rc 0

summary:
/volume1/borg/borgmatic.yaml: Loading configuration file
/volume1/borg/borgmatic.yaml: Successfully ran configuration file
thank you for looking into this so quickly! config: ``` constants: base: /volume1/borg source_directories: - /volume1/xxxxxx - /volume1/yyyyyy/xxxxxx - /volume1/zzzzzz repositories: - path: ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg label: rsyncnet encryption: keyfile storage_quota: 2T make_parent_directories: true working_directory: "{base}" one_file_system: true remote_path: /usr/local/bin/borg1 encryption_passphrase: "xxxxxx" upload_rate_limit: 50000 ssh_command: ssh -i {base}/xxxxxx borg_base_directory: "{base}" keep_daily: 7 keep_weekly: 4 keep_monthly: 6 keep_yearly: 5 ``` log: ``` $ /usr/local/bin/borgmatic -v 2 -c /volume1/borg/borgmatic.yaml extract --archive "xxxxxx-2026-03-01T02:11:20.052779" --path volume1/xxxxxx/yyyy.gz --destination test /volume1/borg/borgmatic.yaml: PGDATA=*** BORG_BASE_DIR=*** BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_DEBUG_PASSPHRASE=*** BORG_DISPLAY_PASSPHRASE=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_USE_CHUNKS_ARCHIVE=*** BORG_EXIT_CODES=*** borg --version --log-json --debug --show-rc /volume1/borg/borgmatic.yaml: Borg 1.4.3 rsyncnet: Running actions for repository rsyncnet: Extracting archive xxxxxx-2026-03-01T02:11:20.052779 rsyncnet: PGDATA=*** BORG_BASE_DIR=*** BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_DEBUG_PASSPHRASE=*** BORG_DISPLAY_PASSPHRASE=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_USE_CHUNKS_ARCHIVE=*** BORG_EXIT_CODES=*** borg extract --remote-path /usr/local/bin/borg1 --log-json --debug --list --show-rc ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg::xxxxxx-2026-03-01T02:11:20.052779 volume1/xxxxxx/yyyy.gz using builtin fallback logging configuration 33 self tests completed in 0.32 seconds SSH command line: ['ssh', '-i', '/volume1/borg/id_synology', 'xxxxxx@xxxxxx.rsync.net', '/usr/local/bin/borg1', 'serve', '--debug'] Remote: using builtin fallback logging configuration Remote: borg selftest disabled via BORG_SELFTEST env variable Remote: using builtin fallback logging configuration Remote: Initialized logging system for JSON-based protocol Remote: Resolving repository path b'/data2/home/xxxxxx/borg' Remote: Resolved repository path to '/data2/home/xxxxxx/borg' Remote: Verified integrity of /data2/home/xxxxxx/borg/index.3405 TAM-verified manifest security: read previous location 'ssh://xxxxxx@xxxxxx.rsync.net/data2/home/xxxxxx/borg' security: read manifest timestamp '2026-03-01T07:27:38.537015' security: determined newest manifest timestamp as 2026-03-01T07:27:38.537015 security: repository checks ok, allowing access Archive authentication DISABLED. TAM-verified archive volume1/xxxxxx/yyyy.gz RemoteRepository: 376.54 kB bytes sent, 148.85 MB bytes received, 7111 messages sent terminating with success status, rc 0 summary: /volume1/borg/borgmatic.yaml: Loading configuration file /volume1/borg/borgmatic.yaml: Successfully ran configuration file ```
Owner

Thanks for providing that info. I notice that you've got a working_directory configured, which borgmatic applies to all (well, most) relative paths. So in this case, if you're doing an extract with --destination test and this config, I'd expect the resulting file(s) to end up in /volume1/borg/test (assuming that directory exists)—not test in your current directory. So do you see the extracted file(s) in /volume1/borg/test?

Thanks for providing that info. I notice that you've got a `working_directory` configured, which borgmatic applies to all (well, most) relative paths. So in this case, if you're doing an `extract` with `--destination test` and this config, I'd expect the resulting file(s) to end up in `/volume1/borg/test` (assuming that directory exists)—not `test` in your current directory. So do you see the extracted file(s) in `/volume1/borg/test`?
Author

aaand... there's the extracted file!

I have an overlay yaml that I use on a non-synology host which changes base to be the same directory where I run the tests on that machine. I think I've tested extractions on the synology itself in the past and they worked, but... I can't prove that.

Thank you for your help, and your patience. While I have your attention: thank you also for maintaining this tool, which is far better than any other remote backup tool I've found on the synology.

aaand... there's the extracted file! I have an overlay yaml that I use on a non-synology host which changes base to be the same directory where I run the tests on _that_ machine. I _think_ I've tested extractions on the synology itself in the past and they worked, but... I can't prove that. Thank you for your help, and your patience. While I have your attention: thank you also for maintaining this tool, which is far better than any other remote backup tool I've found on the synology.
Owner

aaand... there's the extracted file!

I'm glad to hear that was it!

I have an overlay yaml that I use on a non-synology host which changes base to be the same directory where I run the tests on that machine. I think I've tested extractions on the synology itself in the past and they worked, but... I can't prove that.

Hah okay. The working directory semantics have changed with various borgmatic releases, so it's possible it worked on an older version of borgmatic.

Thank you for your help, and your patience. While I have your attention: thank you also for maintaining this tool, which is far better than any other remote backup tool I've found on the synology.

Sure thing. And thank you for using it!

> aaand... there's the extracted file! I'm glad to hear that was it! > I have an overlay yaml that I use on a non-synology host which changes base to be the same directory where I run the tests on _that_ machine. I _think_ I've tested extractions on the synology itself in the past and they worked, but... I can't prove that. Hah okay. The working directory semantics have changed with various borgmatic releases, so it's possible it worked on an older version of borgmatic. > Thank you for your help, and your patience. While I have your attention: thank you also for maintaining this tool, which is far better than any other remote backup tool I've found on the synology. Sure thing. And thank you for using it!
witten 2026-03-02 23:38:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
borgmatic-collective/borgmatic#1280
No description provided.