Overrides are broken with old style config file #829

Closed
opened 2024-02-15 21:13:56 +00:00 by kaysond · 4 comments

What I'm trying to do and why

Run checks using an override

Steps to reproduce

borgmatic --config /etc/borgmatic.d/common/borgmatic.yml --log-file /var/log/borgmatic.log --log-file-verbosity 1 --verbosity 2 --override "consistency.checks=[{name: 'repository'}, {name: 'archives'}]" --repair check

config file:

location:
    one_file_system: true
    numeric_owner: true
    repositories:
        - ssh://x/mnt/arambkup/borg
        - /mnt/extdrive/borg

storage:
    compression: zstd,8
    encryption_passphrase: x
    ssh_command: ssh -i /root/.ssh/borg@x

retention:
    keep_daily: 7
    keep_weekly: 4
    keep_monthly: 2

consistency:
    checks:
        - name: disabled

hooks:
    healthchecks: https://com/ping/6621c7d8-1e54-4067-8ed9-45ec27f082f1

Actual behavior

Checks don't run:

BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc
/etc/borgmatic.d/common/borgmatic.yml: Borg 1.2.7
/etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function initialize_monitor
/etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor
/etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks start
/etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff/start
ssh://borg@borgvm.iyer.lan/mnt/arambkup/borg: Running actions for repository
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-actions hook
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-check hook
ssh://borg@borgvm.iyer.lan/mnt/arambkup/borg: Running consistency checks
BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg info --json ssh://x/mnt/arambkup/borg
The "disabled" value for the "checks" option is deprecated and will be removed from a future release; use "skip_actions" instead
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-check hook
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-actions hook
/mnt/extdrive/borg: Running actions for repository
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-actions hook
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-check hook
/mnt/extdrive/borg: Running consistency checks
BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg info --json /mnt/extdrive/borg
The "disabled" value for the "checks" option is deprecated and will be removed from a future release; use "skip_actions" instead
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-check hook
/etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-actions hook
/etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor
/etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks log
/etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff/log
/etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor
/etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks finish
/etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff
/etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function destroy_monitor

summary:
/etc/borgmatic.d/common/borgmatic.yml: Loading configuration file
/etc/borgmatic.d/common/borgmatic.yml: Configuration sections (like location:, storage:, retention:, consistency:, and hooks:) are deprecated and support will be removed from a future release. To prepare for this, move your options out of sections to the global scope.
/etc/borgmatic.d/common/borgmatic.yml: The healthchecks hook now expects a key/value pair with "ping_url" as a key. String values for this option are deprecated and support will be removed from a future release.
/etc/borgmatic.d/common/borgmatic.yml: The numeric_owner option has been renamed to numeric_ids. numeric_owner is deprecated and support will be removed from a future release.
/etc/borgmatic.d/common/borgmatic.yml: The repositories option now expects a list of key/value pairs. Lists of strings for this option are deprecated and support will be removed from a future release.
/etc/borgmatic.d/common/borgmatic.yml: Successfully ran configuration file

Expected behavior

Checks should actually run

Other notes / implementation ideas

No response

borgmatic version

1.8.8

borgmatic installation method

pip

Borg version

1.2.7

Python version

3.9.2

Database version (if applicable)

No response

Operating system and version

Debian 11

### What I'm trying to do and why Run checks using an override ### Steps to reproduce `borgmatic --config /etc/borgmatic.d/common/borgmatic.yml --log-file /var/log/borgmatic.log --log-file-verbosity 1 --verbosity 2 --override "consistency.checks=[{name: 'repository'}, {name: 'archives'}]" --repair check` config file: ```yml location: one_file_system: true numeric_owner: true repositories: - ssh://x/mnt/arambkup/borg - /mnt/extdrive/borg storage: compression: zstd,8 encryption_passphrase: x ssh_command: ssh -i /root/.ssh/borg@x retention: keep_daily: 7 keep_weekly: 4 keep_monthly: 2 consistency: checks: - name: disabled hooks: healthchecks: https://com/ping/6621c7d8-1e54-4067-8ed9-45ec27f082f1 ``` ### Actual behavior Checks don't run: ``` BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg --version --debug --show-rc /etc/borgmatic.d/common/borgmatic.yml: Borg 1.2.7 /etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function initialize_monitor /etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor /etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks start /etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff/start ssh://borg@borgvm.iyer.lan/mnt/arambkup/borg: Running actions for repository /etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-actions hook /etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-check hook ssh://borg@borgvm.iyer.lan/mnt/arambkup/borg: Running consistency checks BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg info --json ssh://x/mnt/arambkup/borg The "disabled" value for the "checks" option is deprecated and will be removed from a future release; use "skip_actions" instead /etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-check hook /etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-actions hook /mnt/extdrive/borg: Running actions for repository /etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-actions hook /etc/borgmatic.d/common/borgmatic.yml: No commands to run for pre-check hook /mnt/extdrive/borg: Running consistency checks BORG_PASSPHRASE=*** BORG_RSH=*** BORG_EXIT_CODES=*** borg info --json /mnt/extdrive/borg The "disabled" value for the "checks" option is deprecated and will be removed from a future release; use "skip_actions" instead /etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-check hook /etc/borgmatic.d/common/borgmatic.yml: No commands to run for post-actions hook /etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor /etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks log /etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff/log /etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function ping_monitor /etc/borgmatic.d/common/borgmatic.yml: Pinging Healthchecks finish /etc/borgmatic.d/common/borgmatic.yml: Using Healthchecks ping URL https://com/ping/d0df3540-ba11-49e3-9952-90be3470e2ff /etc/borgmatic.d/common/borgmatic.yml: Calling healthchecks hook function destroy_monitor summary: /etc/borgmatic.d/common/borgmatic.yml: Loading configuration file /etc/borgmatic.d/common/borgmatic.yml: Configuration sections (like location:, storage:, retention:, consistency:, and hooks:) are deprecated and support will be removed from a future release. To prepare for this, move your options out of sections to the global scope. /etc/borgmatic.d/common/borgmatic.yml: The healthchecks hook now expects a key/value pair with "ping_url" as a key. String values for this option are deprecated and support will be removed from a future release. /etc/borgmatic.d/common/borgmatic.yml: The numeric_owner option has been renamed to numeric_ids. numeric_owner is deprecated and support will be removed from a future release. /etc/borgmatic.d/common/borgmatic.yml: The repositories option now expects a list of key/value pairs. Lists of strings for this option are deprecated and support will be removed from a future release. /etc/borgmatic.d/common/borgmatic.yml: Successfully ran configuration file ``` ### Expected behavior Checks should actually run ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.8 ### borgmatic installation method pip ### Borg version 1.2.7 ### Python version 3.9.2 ### Database version (if applicable) _No response_ ### Operating system and version Debian 11
Author

There were a lot of messages about deprecated config styles, so I updated all of the config files I have, and things seem to work fine now. Figured I'd report this anyway just in case you want to fix it, but feel free to close.

There were a lot of messages about deprecated config styles, so I updated all of the config files I have, and things seem to work fine now. Figured I'd report this anyway just in case you want to fix it, but feel free to close.
Owner

Thanks for bringing this to my attention! Based on some initial investigation, it looks like borgmatic supports overrides with deprecated section names applying to sectionless config or sectionless overrides applying to config with deprecated section names—but not overrides with deprecated section names applying to config with deprecated section names.

Just for the sake of completion, I'll look into how feasible it would be to fix this.

Thanks for bringing this to my attention! Based on some initial investigation, it looks like borgmatic supports overrides with deprecated section names applying to sectionless config _or_ sectionless overrides applying to config with deprecated section names—but not overrides with deprecated section names applying to config with deprecated section names. Just for the sake of completion, I'll look into how feasible it would be to fix this.
witten added the
bug
label 2024-02-16 03:17:56 +00:00
Owner

Fixed in main! Thanks again.

Fixed in main! Thanks again.
Owner

Released in borgmatic 1.8.9!

Released in borgmatic 1.8.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#829
No description provided.