config file validation fails #698

Closed
opened 2023-05-14 12:05:44 +00:00 by Marcs1974 · 6 comments

What I'm trying to do and why

Setup initial config file

Steps to reproduce (if a bug)

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup. Globs and tildes are
    # expanded. Do not backslash spaces in path names.
    source_directories:
        - /srv/mergerfs/JGPool/LIVE

    # Paths to local or remote repositories (required). Tildes are
    # expanded. Multiple repositories are backed up to in
    # sequence. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. See ssh_command for
    # SSH options like identity file or port. If systemd service
    # is used, then add local repository paths in the systemd
    # service file to the ReadWritePaths list.
    repositories:
        - path: /srv/mergerfs/JGPool/BorgRepo
          label: borgbase


Actual behavior (if a bug)

validate-borgmatic-config
/etc/borgmatic/config.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml:
At 'location': Additional properties are not allowed ('archive_name_format' was unexpected)
At 'location.repositories[0]': {'path': '/srv/mergerfs/JGPool/BorgRepo', 'label': 'borgbase'} is not of type 'string'

Expected behavior (if a bug)

verify config file

Other notes / implementation ideas

borgmatic version: [version here]
1.7.4

borgmatic installation method: [e.g., Debian package, Docker container, etc.]
Debian
Borg version: [version here]
1.2.3.

#### What I'm trying to do and why Setup initial config file #### Steps to reproduce (if a bug) ``` # Where to look for files to backup, and where to store those backups. # See https://borgbackup.readthedocs.io/en/stable/quickstart.html and # https://borgbackup.readthedocs.io/en/stable/usage/create.html # for details. location: # List of source directories to backup. Globs and tildes are # expanded. Do not backslash spaces in path names. source_directories: - /srv/mergerfs/JGPool/LIVE # Paths to local or remote repositories (required). Tildes are # expanded. Multiple repositories are backed up to in # sequence. Borg placeholders can be used. See the output of # "borg help placeholders" for details. See ssh_command for # SSH options like identity file or port. If systemd service # is used, then add local repository paths in the systemd # service file to the ReadWritePaths list. repositories: - path: /srv/mergerfs/JGPool/BorgRepo label: borgbase ``` #### Actual behavior (if a bug) validate-borgmatic-config /etc/borgmatic/config.yaml: Error parsing configuration file An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml: At 'location': Additional properties are not allowed ('archive_name_format' was unexpected) At 'location.repositories[0]': {'path': '/srv/mergerfs/JGPool/BorgRepo', 'label': 'borgbase'} is not of type 'string' #### Expected behavior (if a bug) verify config file #### Other notes / implementation ideas **borgmatic version:** [version here] 1.7.4 **borgmatic installation method:** [e.g., Debian package, Docker container, etc.] Debian **Borg version:** [version here] 1.2.3.
Collaborator

One of the errors that says

At 'location.repositories[0]': {'path': '/srv/mergerfs/JGPool/BorgRepo', 'label': 'borgbase'} is not of type 'string'

is because of your Borgmatic version.

Labels for repos were introduced in version 1.7.10 (ref: https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/NEWS).

For earlier versions it used to be just a list of repo urls.

One of the errors that says ``` At 'location.repositories[0]': {'path': '/srv/mergerfs/JGPool/BorgRepo', 'label': 'borgbase'} is not of type 'string' ``` is because of your Borgmatic version. Labels for repos were introduced in version 1.7.10 (ref: https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/main/NEWS). For earlier versions it used to be just a list of repo urls.
Author

OK. thanks.
I removed the label and removed the 'path:' signifier to accomodate the old version. Same problem, different error message:

# Where to look for files to backup, and where to store those backups.
# See https://borgbackup.readthedocs.io/en/stable/quickstart.html and
# https://borgbackup.readthedocs.io/en/stable/usage/create.html
# for details.
location:
    # List of source directories to backup. Globs and tildes are
    # expanded. Do not backslash spaces in path names.
    source_directories:
        - /srv/mergerfs/JGPool/LIVE

    # Paths to local or remote repositories (required). Tildes are
    # expanded. Multiple repositories are backed up to in
    # sequence. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. See ssh_command for
    # SSH options like identity file or port. If systemd service
    # is used, then add local repository paths in the systemd
    # service file to the ReadWritePaths list.
    repositories:
        - /srv/mergerfs/JGPool/BorgRepo
#          label: borgbase
        #- ssh://user@backupserver/./sourcehostname.borg
        #- ssh://user@backupserver/./{fqdn}
#        - /srv/remotemount/NNnfs2_T17/BorgFrom180
#         label: T17_backup

root@raspberrypi:/etc/borgmatic# validate-borgmatic-config
/etc/borgmatic/config.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml:
At 'location': Additional properties are not allowed ('archive_name_format' was unexpected)

OK. thanks. I removed the label and removed the 'path:' signifier to accomodate the old version. Same problem, different error message: ``` # Where to look for files to backup, and where to store those backups. # See https://borgbackup.readthedocs.io/en/stable/quickstart.html and # https://borgbackup.readthedocs.io/en/stable/usage/create.html # for details. location: # List of source directories to backup. Globs and tildes are # expanded. Do not backslash spaces in path names. source_directories: - /srv/mergerfs/JGPool/LIVE # Paths to local or remote repositories (required). Tildes are # expanded. Multiple repositories are backed up to in # sequence. Borg placeholders can be used. See the output of # "borg help placeholders" for details. See ssh_command for # SSH options like identity file or port. If systemd service # is used, then add local repository paths in the systemd # service file to the ReadWritePaths list. repositories: - /srv/mergerfs/JGPool/BorgRepo # label: borgbase #- ssh://user@backupserver/./sourcehostname.borg #- ssh://user@backupserver/./{fqdn} # - /srv/remotemount/NNnfs2_T17/BorgFrom180 # label: T17_backup ``` root@raspberrypi:/etc/borgmatic# validate-borgmatic-config /etc/borgmatic/config.yaml: Error parsing configuration file An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml: At 'location': Additional properties are not allowed ('archive_name_format' was unexpected)
Collaborator

Can you share your complete config? Looks like 'archive_name_format' is uncommented while it's parent key (storage) is commented.

Can you share your complete config? Looks like 'archive_name_format' is uncommented while it's parent key (storage) is commented.
Author

I found my error.
Further down in the file I was defining archive-name but had 'storage:' commented out. My bad.

I found my error. Further down in the file I was defining archive-name but had 'storage:' commented out. My bad.
Author

thanks for your help.
If I may recommend one feature then remove the hierarchical structure in the config file.
Just parameters would be much much easier to manage.
or alternativelly
keep the hierarchy and comment all top level section headers out by default, and just allow empty sections (if no parameters used)

thanks for your help. If I may recommend one feature then remove the hierarchical structure in the config file. Just parameters would be much much easier to manage. or alternativelly keep the hierarchy and comment all top level section headers out by default, and just allow empty sections (if no parameters used)
Owner

I'm glad to hear you got it sorted out, and thanks for the recommendation. I've considered removing the section headings as you suggest, but there are other parts of the configuration file that benefit from the hierarchy. Maybe it would make sense to remove the top-level hierarchy while leaving the other parts.

I'm glad to hear you got it sorted out, and thanks for the recommendation. I've considered removing the section headings as you suggest, but there are other parts of the configuration file that benefit from the hierarchy. Maybe it would make sense to remove the top-level hierarchy while leaving the other parts.
witten added the
question / support
label 2023-05-14 16:41:38 +00:00
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#698
No description provided.