bootstrap action ignores "--verbosity" when no configuration is present #1336

Closed
opened 2026-07-23 17:18:30 +00:00 by witten · 2 comments
Owner

What I'm trying to do and why

Due to its expected use case of being run on a fresh system before borgmatic is set up yet, the bootstrap action does not expect borgmatic configuration. However, due to a quirk in the way that command-line arguments override configuration file options, if you run bootstrap with a --verbosity flag, then bootstrap ignores that value unless you also provide a configuration file, e.g. with --config.

Steps to reproduce

$ borgmatic -v 2 config bootstrap --repository test.borg

Actual behavior


summary:
Bootstrap successful

(Note the lack of debug logs.)

Expected behavior

BORG_EXIT_CODES=*** borg --version --log-json --debug --show-rc
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg info --remote-path borg --log-json --glob-archives {hostname}-* --json test.borg
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg list --remote-path borg --log-json --glob-archives {hostname}-* --last 1 --json test.borg
Latest archive is flux-2026-07-20T18:59:25.829646 (3ad16973e49b6c5614c000b4c642e4cc8e7c997e24897b124ea45f011874d0b7)
Using runtime directory /run/user/1000/borgmatic
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg extract --remote-path borg --log-json --debug --list --show-rc --stdout /home/witten/Downloads/tmp/test.borg::flux-2026-07-20T18:59:25.829646 sh:borgmatic/bootstrap/manifest.json > -1
Bootstrapping configuration paths: /home/witten/Downloads/tmp/test.yaml
BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg extract --remote-path borg --log-json --debug --list --show-rc /home/witten/Downloads/tmp/test.borg::flux-2026-07-20T18:59:25.829646 home/witten/Downloads/tmp/test.yaml
using builtin fallback logging configuration
33 self tests completed in 0.08 seconds
Verified integrity of /home/witten/Downloads/tmp/test.borg/index.21
TAM-verified manifest
security: read previous location '/home/witten/Downloads/tmp/test.borg'
security: read manifest timestamp '2026-07-21T01:59:50.647462'
security: determined newest manifest timestamp as 2026-07-21T01:59:50.647462
security: repository checks ok, allowing access
Archive authentication DISABLED.
TAM-verified archive
home/witten/Downloads/tmp/test.yaml
terminating with success status, rc 0

summary:
/home/witten/Downloads/tmp/test.yaml: Loading configuration file
Bootstrap successful

Other notes / implementation ideas

The above correct debug logs appear when you add --config test.yaml (with any valid config file) on the command-line. This is because there's now in-memory config file data to set the --verbosity value into, which is how borgmatic actually accesses the verbosity in order to configure logging at the relevant level.

borgmatic version

main

borgmatic installation method

uv tool install --editable

Borg version

1.4.4

Python version

3.14.16

Database version (if applicable)

No response

Operating system and version

Manjaro stable

### What I'm trying to do and why Due to its expected use case of being run on a fresh system before borgmatic is set up yet, the `bootstrap` action does not expect borgmatic configuration. However, due to a quirk in the way that command-line arguments override configuration file options, if you run `bootstrap` with a `--verbosity` flag, then `bootstrap` ignores that value *unless* you also provide a configuration file, e.g. with `--config`. ### Steps to reproduce ```bash $ borgmatic -v 2 config bootstrap --repository test.borg ``` ### Actual behavior ``` summary: Bootstrap successful ``` (Note the lack of debug logs.) ### Expected behavior ``` BORG_EXIT_CODES=*** borg --version --log-json --debug --show-rc BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg info --remote-path borg --log-json --glob-archives {hostname}-* --json test.borg BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg list --remote-path borg --log-json --glob-archives {hostname}-* --last 1 --json test.borg Latest archive is flux-2026-07-20T18:59:25.829646 (3ad16973e49b6c5614c000b4c642e4cc8e7c997e24897b124ea45f011874d0b7) Using runtime directory /run/user/1000/borgmatic BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg extract --remote-path borg --log-json --debug --list --show-rc --stdout /home/witten/Downloads/tmp/test.borg::flux-2026-07-20T18:59:25.829646 sh:borgmatic/bootstrap/manifest.json > -1 Bootstrapping configuration paths: /home/witten/Downloads/tmp/test.yaml BORG_RELOCATED_REPO_ACCESS_IS_OK=*** BORG_EXIT_CODES=*** borg extract --remote-path borg --log-json --debug --list --show-rc /home/witten/Downloads/tmp/test.borg::flux-2026-07-20T18:59:25.829646 home/witten/Downloads/tmp/test.yaml using builtin fallback logging configuration 33 self tests completed in 0.08 seconds Verified integrity of /home/witten/Downloads/tmp/test.borg/index.21 TAM-verified manifest security: read previous location '/home/witten/Downloads/tmp/test.borg' security: read manifest timestamp '2026-07-21T01:59:50.647462' security: determined newest manifest timestamp as 2026-07-21T01:59:50.647462 security: repository checks ok, allowing access Archive authentication DISABLED. TAM-verified archive home/witten/Downloads/tmp/test.yaml terminating with success status, rc 0 summary: /home/witten/Downloads/tmp/test.yaml: Loading configuration file Bootstrap successful ``` ### Other notes / implementation ideas The above correct debug logs appear when you add `--config test.yaml` (with any valid config file) on the command-line. This is because there's now in-memory config file data to set the `--verbosity` value *into*, which is how borgmatic actually accesses the verbosity in order to configure logging at the relevant level. ### borgmatic version main ### borgmatic installation method uv tool install --editable ### Borg version 1.4.4 ### Python version 3.14.16 ### Database version (if applicable) _No response_ ### Operating system and version Manjaro stable
witten changed title from bootstrap action ignores "--verbosity" unless "--config" flag is also used to bootstrap action ignores "--verbosity" when no configuration is present 2026-08-02 00:04:14 +00:00
Author
Owner

Fixed in main! Will be part of the next release.

Fixed in main! Will be part of the next release.
Author
Owner

Released in borgmatic 2.1.7!

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