Cannot use dotslash hack with ZFS hook #1151

Closed
opened 2025-09-25 14:23:13 +00:00 by jacksonchen666 · 2 comments
Contributor

What I'm trying to do and why

I have a ZFS dataset. It is mounted at a specific absolute path.

I specify the absolute path as a source_directory and also enable built-in ZFS hook. I also want to use the dotslash hack to trim the absolute path off, but that's ineffective.

Steps to reproduce

Minimum relevant config:

source_directories:
  - /path/to/dataset/./
zfs:

Actual behavior

Logs
/etc/borgmatic/zfs.yaml: Skipping compact action due to configured skip_actions
/etc/borgmatic/zfs.yaml: Calling ntfy hook function initialize_monitor
/etc/borgmatic/zfs.yaml: Calling ntfy hook function ping_monitor
/etc/borgmatic/zfs.yaml: Pinging ntfy topic backup-flattop
/etc/borgmatic/zfs.yaml: Using Ntfy ping URL [REDACTED]
/etc/borgmatic/zfs.yaml: Calling file hook function load_credential
/etc/borgmatic/zfs.yaml: Calling file hook function load_credential
/etc/borgmatic/zfs.yaml: 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_CHECK_I_KNOW_WHAT_I_AM_DOING=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc
/etc/borgmatic/zfs.yaml: Borg 1.4.1
borgbase: Running actions for repository
borgbase: Creating archive
borgbase: Using runtime directory /tmp/borgmatic-0zv0eg9l/borgmatic
borgbase: Calling bootstrap hook function remove_data_source_dumps
borgbase: Looking for bootstrap manifest files to remove in /tmp/borgmatic-*/borgmatic/bootstrap
borgbase: Calling btrfs hook function remove_data_source_dumps
borgbase: Calling lvm hook function remove_data_source_dumps
borgbase: Calling mariadb hook function remove_data_source_dumps
borgbase: Removing MariaDB data source dumps
borgbase: Calling mongodb hook function remove_data_source_dumps
borgbase: Removing MongoDB data source dumps
borgbase: Calling mysql hook function remove_data_source_dumps
borgbase: Removing MySQL data source dumps
borgbase: Calling postgresql hook function remove_data_source_dumps
borgbase: Removing PostgreSQL data source dumps
borgbase: Calling sqlite hook function remove_data_source_dumps
borgbase: Removing SQLite data source dumps
borgbase: Calling zfs hook function remove_data_source_dumps
borgbase: zfs list -H -t filesystem -o mountpoint
borgbase: Looking for snapshots to remove in /tmp/borgmatic-*/borgmatic/zfs_snapshots/*
borgbase: Unmounting ZFS snapshot at /tmp/borgmatic-j80_yott/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson
borgbase: umount /tmp/borgmatic-j80_yott/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson
borgbase: zfs list -H -t snapshot -o name
borgbase: Destroying ZFS snapshot nas-zfs/jackson@borgmatic-32294
borgbase: zfs destroy nas-zfs/jackson@borgmatic-32294
borgbase: Calling bootstrap hook function dump_data_sources
borgbase: Calling zfs hook function dump_data_sources
borgbase: Snapshotting ZFS datasets
borgbase: zfs list -H -t filesystem -o name,mountpoint,canmount,org.torsion.borgmatic:backup
borgbase: Creating ZFS snapshot nas-zfs/jackson@borgmatic-2647 of /nas-zfs/jackson
borgbase: zfs snapshot nas-zfs/jackson@borgmatic-2647
borgbase: Mounting ZFS snapshot nas-zfs/jackson@borgmatic-2647 at /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson
borgbase: mount -t zfs -o ro nas-zfs/jackson@borgmatic-2647 /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson
borgbase: Writing patterns to /tmp/borgmatic-0zv0eg9l/borgmatic/tmpv2frjood:
R /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/./
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED]
R /etc/borgmatic/zfs.yaml
R /tmp/borgmatic-0zv0eg9l/./borgmatic/bootstrap
borgbase: 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_CHECK_I_KNOW_WHAT_I_AM_DOING=*** BORG_EXIT_CODES=*** borg create --patterns-from /tmp/borgmatic-0zv0eg9l/borgmatic/tmpv2frjood --exclude-if-present BORGMATIC.NOBACKUP --comment initial filesystem and host change of data --checkpoint-interval 1800 --compression auto,zstd,12 --upload-ratelimit 62500 --one-file-system --umask 22 --lock-wait 60 --stats --debug --show-rc --progress ssh://t9u5mt4n@t9u5mt4n.repo.borgbase.com/./repo::{hostname}-Jackson-drive-{now:%Y-%m-%dT%H:%M:%S} > <object object at 0x7f58c6378dd0>
using builtin fallback logging configuration
33 self tests completed in 0.16 seconds
SSH command line: ['ssh', '[REDACTED]', 'borg', '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'/./repo'
Remote: Resolved repository path to '/[REDACTED REMOTE]'
Remote: Verified integrity of /[REDACTED REMOTE]
TAM-verified manifest
security: read previous location 'ssh://[REDACTED]'
security: read manifest timestamp '2025-09-25T07:49:38.253687'
security: determined newest manifest timestamp as 2025-09-25T07:49:38.253687
security: repository checks ok, allowing access
Creating archive at "ssh://[REDACTED]::flattop-Jackson-drive-2025-09-25T09:57:09"
Verified integrity of /root/.cache/borg/35936e3d36990e408522b60dd39127a0fbc352ddfc05af08bfd9ecd80d872133/chunks
Reading files cache ...
Verified integrity of /root/.cache/borg/35936e3d36990e408522b60dd39127a0fbc352ddfc05af08bfd9ecd80d872133/files
security: read previous location 'ssh://t9u5mt4n@t9u5mt4n.repo.borgbase.com/./repo'
security: read manifest timestamp '2025-09-25T07:49:38.253687'
security: determined newest manifest timestamp as 2025-09-25T07:49:38.253687
security: repository checks ok, allowing access
Processing files ...
36.87 GB O 36.46 GB C 0 B D 8462 N nas-zfs/jackson/[REDACTED]
Slightly reduced, mostly complete config
source_directories:
    - /nas-zfs/jackson/./
repositories:
    - path: EXAMPLE
      label: alabelorsmth
      encryption: repokey-blake2
one_file_system: true
flags: true
exclude_from:
    - somewhere
exclude_caches: false
exclude_if_present:
    - BORGMATIC.NOBACKUP
source_directories_must_exist: true
encryption_passphrase: "{credential file /path-to-a-file}"
checkpoint_interval: 1800
compression: auto,zstd,12
upload_rate_limit: 62500
retries: 5
retry_wait: 10
umask: 22
lock_wait: 60
#archive_name_format: # yeeted
#match_archives: # yeeted
relocated_repo_access_is_ok: false
unknown_unencrypted_repo_access_is_ok: false
check_i_know_what_i_am_doing: false
keep_within: 24H
keep_hourly: 27
keep_daily: 21
keep_weekly: 8
#1150 checks:
# section removed
check_last: 3
skip_actions:
    - compact
bootstrap:
    store_config_files: true
#ntfy:
# section removed
zfs:

Expected behavior

Be able to use the dotslash hack myself without borgmatic adding its own and making it ineffective

Other notes / implementation ideas

I already use borgmatic with the LVM hook, but I don't think I am running into this problem while using it for / which is mounted on /, which is probably why I wasn't bothered until now.

borgmatic version

2.0.7

borgmatic installation method

Alpine Linux packages

Borg version

1.4.1

Python version

3.12.11

Database version (if applicable)

N/A

Operating system and version

Alpine Linux 3.22.1

### What I'm trying to do and why I have a ZFS dataset. It is mounted at a specific absolute path. I specify the absolute path as a `source_directory` and also enable built-in ZFS hook. I also want to use the dotslash hack to trim the absolute path off, but that's ineffective. ### Steps to reproduce Minimum relevant config: ``` source_directories: - /path/to/dataset/./ zfs: ``` ### Actual behavior <details><summary>Logs</summary> ``` /etc/borgmatic/zfs.yaml: Skipping compact action due to configured skip_actions /etc/borgmatic/zfs.yaml: Calling ntfy hook function initialize_monitor /etc/borgmatic/zfs.yaml: Calling ntfy hook function ping_monitor /etc/borgmatic/zfs.yaml: Pinging ntfy topic backup-flattop /etc/borgmatic/zfs.yaml: Using Ntfy ping URL [REDACTED] /etc/borgmatic/zfs.yaml: Calling file hook function load_credential /etc/borgmatic/zfs.yaml: Calling file hook function load_credential /etc/borgmatic/zfs.yaml: 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_CHECK_I_KNOW_WHAT_I_AM_DOING=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc /etc/borgmatic/zfs.yaml: Borg 1.4.1 borgbase: Running actions for repository borgbase: Creating archive borgbase: Using runtime directory /tmp/borgmatic-0zv0eg9l/borgmatic borgbase: Calling bootstrap hook function remove_data_source_dumps borgbase: Looking for bootstrap manifest files to remove in /tmp/borgmatic-*/borgmatic/bootstrap borgbase: Calling btrfs hook function remove_data_source_dumps borgbase: Calling lvm hook function remove_data_source_dumps borgbase: Calling mariadb hook function remove_data_source_dumps borgbase: Removing MariaDB data source dumps borgbase: Calling mongodb hook function remove_data_source_dumps borgbase: Removing MongoDB data source dumps borgbase: Calling mysql hook function remove_data_source_dumps borgbase: Removing MySQL data source dumps borgbase: Calling postgresql hook function remove_data_source_dumps borgbase: Removing PostgreSQL data source dumps borgbase: Calling sqlite hook function remove_data_source_dumps borgbase: Removing SQLite data source dumps borgbase: Calling zfs hook function remove_data_source_dumps borgbase: zfs list -H -t filesystem -o mountpoint borgbase: Looking for snapshots to remove in /tmp/borgmatic-*/borgmatic/zfs_snapshots/* borgbase: Unmounting ZFS snapshot at /tmp/borgmatic-j80_yott/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson borgbase: umount /tmp/borgmatic-j80_yott/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson borgbase: zfs list -H -t snapshot -o name borgbase: Destroying ZFS snapshot nas-zfs/jackson@borgmatic-32294 borgbase: zfs destroy nas-zfs/jackson@borgmatic-32294 borgbase: Calling bootstrap hook function dump_data_sources borgbase: Calling zfs hook function dump_data_sources borgbase: Snapshotting ZFS datasets borgbase: zfs list -H -t filesystem -o name,mountpoint,canmount,org.torsion.borgmatic:backup borgbase: Creating ZFS snapshot nas-zfs/jackson@borgmatic-2647 of /nas-zfs/jackson borgbase: zfs snapshot nas-zfs/jackson@borgmatic-2647 borgbase: Mounting ZFS snapshot nas-zfs/jackson@borgmatic-2647 at /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson borgbase: mount -t zfs -o ro nas-zfs/jackson@borgmatic-2647 /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/nas-zfs/jackson borgbase: Writing patterns to /tmp/borgmatic-0zv0eg9l/borgmatic/tmpv2frjood: R /tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/./ ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] ! fm:/tmp/borgmatic-0zv0eg9l/borgmatic/zfs_snapshots/1a11fc543defa56bfca1/./nas-zfs/jackson/[REDACTED] R /etc/borgmatic/zfs.yaml R /tmp/borgmatic-0zv0eg9l/./borgmatic/bootstrap borgbase: 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_CHECK_I_KNOW_WHAT_I_AM_DOING=*** BORG_EXIT_CODES=*** borg create --patterns-from /tmp/borgmatic-0zv0eg9l/borgmatic/tmpv2frjood --exclude-if-present BORGMATIC.NOBACKUP --comment initial filesystem and host change of data --checkpoint-interval 1800 --compression auto,zstd,12 --upload-ratelimit 62500 --one-file-system --umask 22 --lock-wait 60 --stats --debug --show-rc --progress ssh://t9u5mt4n@t9u5mt4n.repo.borgbase.com/./repo::{hostname}-Jackson-drive-{now:%Y-%m-%dT%H:%M:%S} > <object object at 0x7f58c6378dd0> using builtin fallback logging configuration 33 self tests completed in 0.16 seconds SSH command line: ['ssh', '[REDACTED]', 'borg', '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'/./repo' Remote: Resolved repository path to '/[REDACTED REMOTE]' Remote: Verified integrity of /[REDACTED REMOTE] TAM-verified manifest security: read previous location 'ssh://[REDACTED]' security: read manifest timestamp '2025-09-25T07:49:38.253687' security: determined newest manifest timestamp as 2025-09-25T07:49:38.253687 security: repository checks ok, allowing access Creating archive at "ssh://[REDACTED]::flattop-Jackson-drive-2025-09-25T09:57:09" Verified integrity of /root/.cache/borg/35936e3d36990e408522b60dd39127a0fbc352ddfc05af08bfd9ecd80d872133/chunks Reading files cache ... Verified integrity of /root/.cache/borg/35936e3d36990e408522b60dd39127a0fbc352ddfc05af08bfd9ecd80d872133/files security: read previous location 'ssh://t9u5mt4n@t9u5mt4n.repo.borgbase.com/./repo' security: read manifest timestamp '2025-09-25T07:49:38.253687' security: determined newest manifest timestamp as 2025-09-25T07:49:38.253687 security: repository checks ok, allowing access Processing files ... 36.87 GB O 36.46 GB C 0 B D 8462 N nas-zfs/jackson/[REDACTED] ``` </details> <details><summary>Slightly reduced, mostly complete config</summary> ``` source_directories: - /nas-zfs/jackson/./ repositories: - path: EXAMPLE label: alabelorsmth encryption: repokey-blake2 one_file_system: true flags: true exclude_from: - somewhere exclude_caches: false exclude_if_present: - BORGMATIC.NOBACKUP source_directories_must_exist: true encryption_passphrase: "{credential file /path-to-a-file}" checkpoint_interval: 1800 compression: auto,zstd,12 upload_rate_limit: 62500 retries: 5 retry_wait: 10 umask: 22 lock_wait: 60 #archive_name_format: # yeeted #match_archives: # yeeted relocated_repo_access_is_ok: false unknown_unencrypted_repo_access_is_ok: false check_i_know_what_i_am_doing: false keep_within: 24H keep_hourly: 27 keep_daily: 21 keep_weekly: 8 #1150 checks: # section removed check_last: 3 skip_actions: - compact bootstrap: store_config_files: true #ntfy: # section removed zfs: ``` </details> ### Expected behavior Be able to use the dotslash hack myself without borgmatic adding its own and making it ineffective ### Other notes / implementation ideas I already use borgmatic with the LVM hook, but I don't think I am running into this problem while using it for `/` which is mounted on `/`, which is probably why I wasn't bothered until now. ### borgmatic version 2.0.7 ### borgmatic installation method Alpine Linux packages ### Borg version 1.4.1 ### Python version 3.12.11 ### Database version (if applicable) N/A ### Operating system and version Alpine Linux 3.22.1
Owner

Well that's certainly an edge case I didn't anticipate.. Thanks for filing it! I've just pushed a fix to main for ZFS, Btrfs, and LVM hooks, which will be part of the next release. (The fix is to omit inserting the slashdot hack into a snapshot path if there's already a /./ present in the source pattern.)

Well that's certainly an edge case I didn't anticipate.. Thanks for filing it! I've just pushed a fix to main for ZFS, Btrfs, and LVM hooks, which will be part of the next release. (The fix is to omit inserting the slashdot hack into a snapshot path if there's already a `/./` present in the source pattern.)
witten 2025-09-25 17:25:58 +00:00
  • closed this issue
  • added the
    bug
    label
Owner

Released in borgmatic 2.0.9!

Released in borgmatic 2.0.9!
Sign in to join this conversation.
No milestone
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#1151
No description provided.