borgmatic diff uses arguments that borg does not understand #1327

Closed
opened 2026-06-24 14:18:27 +00:00 by agross · 3 comments

What I'm trying to do and why

I want to diff 2 archives.

I have exclude_if_present: ['.nobackup'] im my borgmatic yaml:

$ sudo borgmatic -c /etc/borgmatic.d/nextcloud.yaml diff --archive latest --second-archive cloud-nextcloud-2026-06-23T01:33:17 -v 2
/etc/borgmatic.d/nextcloud.yaml: Borg 1.4.4
ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud: BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg diff --log-json --lock-wait 5 --debug --show-rc --exclude-caches --exclude-if-present .nobackup --keep-exclude-tags --numeric-ids ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud::cloud-nextcloud-2026-06-24T01:42:15 cloud-nextcloud-2026-06-23T01:33:17
usage: borg diff [-h] [--critical] [--error] [--warning] [--info] [--debug]
                 [--debug-topic TOPIC] [-p] [--iec] [--log-json]
                 [--lock-wait SECONDS] [--bypass-lock] [--show-version]
                 [--show-rc] [--umask M] [--remote-path PATH]
                 [--remote-ratelimit RATE] [--upload-ratelimit RATE]
                 [--remote-buffer UPLOAD_BUFFER]
                 [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
                 [--debug-profile FILE] [--rsh RSH] [--numeric-owner]
                 [--numeric-ids] [--same-chunker-params] [--sort]
                 [--sort-by FIELD[,FIELD...]] [--content-only] [--json-lines]
                 [-e PATTERN] [--exclude-from EXCLUDEFILE] [--pattern PATTERN]
                 [--patterns-from PATTERNFILE]
                 REPO::ARCHIVE1 ARCHIVE2 [PATH ...]
borg diff: error: argument REPO::ARCHIVE1: ".nobackup": No archive specified

After commenting exclude_if_present:

$ sudo borgmatic -c /etc/borgmatic.d/nextcloud.yaml diff --archive latest --second-archive cloud-nextcloud-2026-06-23T01:33:17 -v 2
...
BORG_EXIT_CODES=*** borg diff --log-json --lock-wait 5 --debug --show-rc --exclude-caches --keep-exclude-tags --numeric-ids ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud::cloud-nextcloud-2026-06-24T01:42:15 cloud-nextcloud-2026-06-23T01:33:17
usage: borg [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug]
            [--debug-topic TOPIC] [-p] [--iec] [--log-json]
            [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc]
            [--umask M] [--remote-path PATH] [--remote-ratelimit RATE]
            [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER]
            [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
            [--debug-profile FILE] [--rsh RSH]
            <command> ...
borg: error: unrecognized arguments: --exclude-caches --keep-exclude-tags

After commenting exclude_caches: true and keep_exclude_tags: true the command finally runs.

Steps to reproduce

Configure exclude_caches: true, keep_exclude_tags: true or exclude_if_present: ['something']

Actual behavior

No response

Expected behavior

Works without messing with config files first.

Other notes / implementation ideas

No response

borgmatic version

2.1.6

borgmatic installation method

dnf

Borg version

1.4.4

Python version

Python 3.14.6

Database version (if applicable)

No response

Operating system and version

Fedora

### What I'm trying to do and why I want to diff 2 archives. I have `exclude_if_present: ['.nobackup']` im my borgmatic yaml: ``` $ sudo borgmatic -c /etc/borgmatic.d/nextcloud.yaml diff --archive latest --second-archive cloud-nextcloud-2026-06-23T01:33:17 -v 2 /etc/borgmatic.d/nextcloud.yaml: Borg 1.4.4 ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud: BORG_RSH=*** BORG_PASSPHRASE_FD=*** BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg diff --log-json --lock-wait 5 --debug --show-rc --exclude-caches --exclude-if-present .nobackup --keep-exclude-tags --numeric-ids ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud::cloud-nextcloud-2026-06-24T01:42:15 cloud-nextcloud-2026-06-23T01:33:17 usage: borg diff [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--iec] [--log-json] [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc] [--umask M] [--remote-path PATH] [--remote-ratelimit RATE] [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER] [--upload-buffer UPLOAD_BUFFER] [--consider-part-files] [--debug-profile FILE] [--rsh RSH] [--numeric-owner] [--numeric-ids] [--same-chunker-params] [--sort] [--sort-by FIELD[,FIELD...]] [--content-only] [--json-lines] [-e PATTERN] [--exclude-from EXCLUDEFILE] [--pattern PATTERN] [--patterns-from PATTERNFILE] REPO::ARCHIVE1 ARCHIVE2 [PATH ...] borg diff: error: argument REPO::ARCHIVE1: ".nobackup": No archive specified ``` After commenting `exclude_if_present`: ``` $ sudo borgmatic -c /etc/borgmatic.d/nextcloud.yaml diff --archive latest --second-archive cloud-nextcloud-2026-06-23T01:33:17 -v 2 ... BORG_EXIT_CODES=*** borg diff --log-json --lock-wait 5 --debug --show-rc --exclude-caches --keep-exclude-tags --numeric-ids ssh://u619662-sub2@u619662-sub2.your-storagebox.de:23/./cloud::cloud-nextcloud-2026-06-24T01:42:15 cloud-nextcloud-2026-06-23T01:33:17 usage: borg [-V] [-h] [--critical] [--error] [--warning] [--info] [--debug] [--debug-topic TOPIC] [-p] [--iec] [--log-json] [--lock-wait SECONDS] [--bypass-lock] [--show-version] [--show-rc] [--umask M] [--remote-path PATH] [--remote-ratelimit RATE] [--upload-ratelimit RATE] [--remote-buffer UPLOAD_BUFFER] [--upload-buffer UPLOAD_BUFFER] [--consider-part-files] [--debug-profile FILE] [--rsh RSH] <command> ... borg: error: unrecognized arguments: --exclude-caches --keep-exclude-tags ``` After commenting `exclude_caches: true` and `keep_exclude_tags: true` the command finally runs. ### Steps to reproduce Configure `exclude_caches: true`, `keep_exclude_tags: true` or `exclude_if_present: ['something']` ### Actual behavior _No response_ ### Expected behavior Works without messing with config files first. ### Other notes / implementation ideas _No response_ ### borgmatic version 2.1.6 ### borgmatic installation method dnf ### Borg version 1.4.4 ### Python version Python 3.14.6 ### Database version (if applicable) _No response_ ### Operating system and version Fedora

Experiencing the same behavior here also with borgmatic 2.1.6. Diff should automatically refrain from adding to the borg diff command line those arguments that borg diff cannot understand. Currently borgmatic diff is broken with most configurations, but creating the "parameter filter" should fix it, thanks for the tool!

Experiencing the same behavior here also with borgmatic 2.1.6. Diff should automatically refrain from adding to the borg diff command line those arguments that borg diff cannot understand. Currently `borgmatic diff` is broken with most configurations, but creating the "parameter filter" should fix it, thanks for the tool!
Owner

@agross thanks for filing this! And thanks to @callegar as well for weighing in. This issue is now fixed in main and will be part of the next release. Let me know if you find any other configuration options that break the diff action.. I found and fixed three others as part of this ticket, all of them related to excludes.

@agross thanks for filing this! And thanks to @callegar as well for weighing in. This issue is now fixed in main and will be part of the next release. Let me know if you find any other configuration options that break the `diff` action.. I found and fixed three others as part of this ticket, all of them related to excludes.
Owner

Released in borgmatic 2.1.7!

Released in borgmatic 2.1.7!
Sign in to join this conversation.
No milestone
No assignees
3 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#1327
No description provided.