Spot check not recognised by yaml schema #904

Closed
opened 2024-08-13 04:27:03 +00:00 by deafmute1 · 6 comments

What I'm trying to do and why

Use the spot check.

Steps to reproduce

checks:
    - name: spot
    - name: repository
      frequency: 1 week
      only_run_on:
        - Saturday
        - Sunday
    - name: data
      frequency: 2 weeks
      only_run_on:
        - Saturday
        - Sunday
    - name: extract
      frequency: 1 month
      only_run_on:
        - Saturday
        - Sunday

No matter what variations of values I try within the -name: spot block, config will not validate. Removing that block/line, the schema validates successfully.

Actual behavior

Output of borgmatic config validate:

summary:
/etc/borgmatic.d/local.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic.d/local.yaml:
At 'checks[0]': {'name': 'spot'} is not valid under any of the given schemas

Expected behavior

Spot check should be a valid name per config reference of current version.

Other notes / implementation ideas

No response

borgmatic version

1.8.13

borgmatic installation method

container: modem7/borgmatic-docker

Borg version

1.4.0

Python version

3.12.4

Database version (if applicable)

No response

Operating system and version

No response

### What I'm trying to do and why Use the spot check. ### Steps to reproduce ``` checks: - name: spot - name: repository frequency: 1 week only_run_on: - Saturday - Sunday - name: data frequency: 2 weeks only_run_on: - Saturday - Sunday - name: extract frequency: 1 month only_run_on: - Saturday - Sunday ``` No matter what variations of values I try within the `-name: spot` block, config will not validate. Removing that block/line, the schema validates successfully. ### Actual behavior Output of `borgmatic config validate`: ``` summary: /etc/borgmatic.d/local.yaml: Error parsing configuration file An error occurred while parsing a configuration file at /etc/borgmatic.d/local.yaml: At 'checks[0]': {'name': 'spot'} is not valid under any of the given schemas ``` ### Expected behavior Spot check should be a valid name per config reference of current version. ### Other notes / implementation ideas _No response_ ### borgmatic version 1.8.13 ### borgmatic installation method container: modem7/borgmatic-docker ### Borg version 1.4.0 ### Python version 3.12.4 ### Database version (if applicable) _No response_ ### Operating system and version _No response_
Owner

Thanks for the detailed ticket! The problem is that the other spot options are required (count_tolerance_percentage, data_sample_percentage, and data_tolerance_percentage), and so the configuration validation isn't recognizing the spot check without them. That leads to the error you're seeing. See the documentation for an example and more details.

I'd love to make this situation have a better error message, but for some pretty esoteric compatibility reasons, I don't have a good way to do that right now.

Thanks for the detailed ticket! The problem is that the other `spot` options are required (`count_tolerance_percentage`, `data_sample_percentage`, and `data_tolerance_percentage`), and so the configuration validation isn't recognizing the `spot` check without them. That leads to the error you're seeing. See [the documentation](https://torsion.org/borgmatic/docs/how-to/deal-with-very-large-backups/#spot-check) for an example and more details. I'd love to make this situation have a better error message, but for some pretty esoteric compatibility reasons, I don't have a good way to do that right now.
witten added the
question / support
label 2024-08-13 04:41:07 +00:00
Author

Ah, I see. I know its a very new feature, but my recommendation is to mention this in the configuration reference - its pretty much my go to for documentation for borgmatic. I also generally expect config references to mention if values are required, and assume they're optional/have a default value unless otherwise stated.

Ah, I see. I know its a very new feature, but my recommendation is to mention this in the configuration reference - its pretty much my go to for documentation for borgmatic. I also generally expect config references to mention if values are required, and assume they're optional/have a default value unless otherwise stated.
Owner

Good idea! Where would it have been most helpful in the configuration reference? In the comment about the name option or in the comments for the individual spot-specific options?

Good idea! Where would it have been most helpful in the configuration reference? In the comment about the `name` option or in the comments for the individual `spot`-specific options?
Author

There is validity in both to me. Looking at it currently, the description for "name" value is a bit wordy and hard to parse at a glance, so if included there I'd break the explanations of each action up with some line breaks or indentation. Otherwise, I'd include it with the values - they already mention that the values are only relevant for spot, you can simply slip and extra word or two in there.

There is validity in both to me. Looking at it currently, the description for "name" value is a bit wordy and hard to parse at a glance, so if included there I'd break the explanations of each action up with some line breaks or indentation. Otherwise, I'd include it with the values - they already mention that the values are _only_ relevant for spot, you can simply slip and extra word or two in there.
Owner

Understood. Thank you!

Understood. Thank you!
Owner

Done. These clarifications should show up on the website shortly. Thanks again!

Done. These clarifications should show up on the website shortly. Thanks again!
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: borgmatic-collective/borgmatic#904
No description provided.