borgmatic 1.7.13 fails to load config (?) #703

Closed
opened 2023-05-28 07:51:52 +00:00 by agross · 3 comments

What I'm trying to do and why

Steps to reproduce (if a bug)

$ borgmatic --version
1.7.13

agross@gateway-ogd ~
$ sudo borgmatic info
Traceback (most recent call last):
  File "/usr/bin/borgmatic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 735, in main
    configs, parse_logs = load_configurations(
                          ^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 508, in load_configurations
    config_filename, validate.schema_filename(), overrides, resolve_env
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/borgmatic/config/validate.py", line 23, in schema_filename
    return next(
               ^
TypeError: 'NoneType' object is not iterable
---
# Managed by Ansible, please don't edit manually

# Full config: https://torsion.org/borgmatic/docs/reference/config.yaml
location:
    source_directories:
        - /etc

    # Stay in same file system (do not cross mount points).
    one_file_system: True
    repositories:
        - ssh://example.com/volume2/NetBackup/borg/ogd/gateway

    # Store atime into archive.
    atime: False

    # Store ctime into archive.
    ctime: True


    # Exclude directories that contain a CACHEDIR.TAG file. See
    # http://www.brynosaurus.com/cachedir/spec.html for details.
    exclude_caches: true

    # Exclude directories that contain a file with the given filename.
    exclude_if_present: .nobackup

    # Alternate Borg remote executable. Defaults to "borg".
    # remote_path: borg1
    remote_path: /usr/local/bin/borg

# Repository storage options. See
# https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create and
# https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for
# details.
storage:
    encryption_passphrase: secret

    # The standard output of this command is used to unlock the encryption key. Only
    # use on repositories that were initialized with passcommand/repokey encryption.
    # Note that if both encryption_passcommand and encryption_passphrase are set,
    # then encryption_passphrase takes precedence.
    # encryption_passcommand: secret-tool lookup borg-repository repo-name

    # Type of compression to use when creating archives. See
    # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-create for details.
    # Defaults to no compression.
    compression: auto,zstd

    # Remote network upload rate limit in kiBytes/second.

    # Command to use instead of just "ssh". This can be used to specify ssh options.
    # ssh_command: ssh -i ~/.ssh/id_ed25519
    ssh_command: ssh -o User=backup -i "/root/.ssh/borg-backup" -o StrictHostKeyChecking=accept-new

    # Umask to be used for borg create.
    umask: 0077

    # Maximum seconds to wait for acquiring a repository/cache lock.
    lock_wait: 5

    # Name of the archive. Borg placeholders can be used. See the output of
    # "borg help placeholders" for details. Default is
    # "{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}". If you specify this option, you must
    # also specify a prefix in the retention section to avoid accidental pruning of
    # archives with a different archive name format. And you should also specify a
    # prefix in the consistency section as well.
    archive_name_format: '{hostname}-system-{now}'
    match_archives: 'sh:{hostname}-system-*'

    # Bypass Borg error about a repository that has been moved.
    relocated_repo_access_is_ok: True

# Retention policy for how many backups to keep in each category. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details.
# At least one of the "keep" options is required for pruning to work.
retention:


    # Number of hourly archives to keep.
    keep_hourly: 3

    # Number of daily archives to keep.
    keep_daily: 7

    # Number of weekly archives to keep.
    keep_weekly: 4

    # Number of monthly archives to keep.
    keep_monthly: 6


# Consistency checks to run after backups. See
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and
# https://borgbackup.readthedocs.org/en/stable/usage.html#borg-extract for details.
consistency:
    # List of one or more consistency checks to run: "repository",
    # "archives", "data", and/or "extract". Defaults to
    # "repository" and "archives". Set to "disabled" to disable
    # all consistency checks. "repository" checks the consistency
    # of the repository, "archives" checks all of the archives,
    # "data" verifies the integrity of the data within the
    # archives, and "extract" does an extraction dry-run of the
    # most recent archive. Note that "data" implies "archives".
    checks:
        - {'name': 'repository', 'frequency': '4 weeks'}
        - {'name': 'archives', 'frequency': '6 weeks'}

    # Restrict the number of checked archives to the last n. Applies only to the "archives" check.
    check_last: 3

# Shell commands or scripts to execute before and after a backup or if an error has occurred.
# IMPORTANT: All provided commands and scripts are executed with user permissions of borgmatic.
# Do not forget to set secure permissions on this file as well as on any script listed (chmod 0700) to
# prevent potential shell injection or privilege escalation.
hooks:
    healthchecks:
        ping_url: https://healthchecks.io/ping/...

Environment

borgmatic version: 1.7.13

borgmatic installation method: dnf on Fedora

Borg version: borg 1.2.4

Python version: Python 3.11.3

operating system and version: Linux gateway 6.2.15-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 17:37:39 UTC 2023 x86_64 GNU/Linux

#### What I'm trying to do and why #### Steps to reproduce (if a bug) ```sh $ borgmatic --version 1.7.13 agross@gateway-ogd ~ $ sudo borgmatic info Traceback (most recent call last): File "/usr/bin/borgmatic", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 735, in main configs, parse_logs = load_configurations( ^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/commands/borgmatic.py", line 508, in load_configurations config_filename, validate.schema_filename(), overrides, resolve_env ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/site-packages/borgmatic/config/validate.py", line 23, in schema_filename return next( ^ TypeError: 'NoneType' object is not iterable ``` ```yaml --- # Managed by Ansible, please don't edit manually # Full config: https://torsion.org/borgmatic/docs/reference/config.yaml location: source_directories: - /etc # Stay in same file system (do not cross mount points). one_file_system: True repositories: - ssh://example.com/volume2/NetBackup/borg/ogd/gateway # Store atime into archive. atime: False # Store ctime into archive. ctime: True # Exclude directories that contain a CACHEDIR.TAG file. See # http://www.brynosaurus.com/cachedir/spec.html for details. exclude_caches: true # Exclude directories that contain a file with the given filename. exclude_if_present: .nobackup # Alternate Borg remote executable. Defaults to "borg". # remote_path: borg1 remote_path: /usr/local/bin/borg # Repository storage options. See # https://borgbackup.readthedocs.io/en/stable/usage.html#borg-create and # https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables for # details. storage: encryption_passphrase: secret # The standard output of this command is used to unlock the encryption key. Only # use on repositories that were initialized with passcommand/repokey encryption. # Note that if both encryption_passcommand and encryption_passphrase are set, # then encryption_passphrase takes precedence. # encryption_passcommand: secret-tool lookup borg-repository repo-name # Type of compression to use when creating archives. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-create for details. # Defaults to no compression. compression: auto,zstd # Remote network upload rate limit in kiBytes/second. # Command to use instead of just "ssh". This can be used to specify ssh options. # ssh_command: ssh -i ~/.ssh/id_ed25519 ssh_command: ssh -o User=backup -i "/root/.ssh/borg-backup" -o StrictHostKeyChecking=accept-new # Umask to be used for borg create. umask: 0077 # Maximum seconds to wait for acquiring a repository/cache lock. lock_wait: 5 # Name of the archive. Borg placeholders can be used. See the output of # "borg help placeholders" for details. Default is # "{hostname}-{now:%Y-%m-%dT%H:%M:%S.%f}". If you specify this option, you must # also specify a prefix in the retention section to avoid accidental pruning of # archives with a different archive name format. And you should also specify a # prefix in the consistency section as well. archive_name_format: '{hostname}-system-{now}' match_archives: 'sh:{hostname}-system-*' # Bypass Borg error about a repository that has been moved. relocated_repo_access_is_ok: True # Retention policy for how many backups to keep in each category. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-prune for details. # At least one of the "keep" options is required for pruning to work. retention: # Number of hourly archives to keep. keep_hourly: 3 # Number of daily archives to keep. keep_daily: 7 # Number of weekly archives to keep. keep_weekly: 4 # Number of monthly archives to keep. keep_monthly: 6 # Consistency checks to run after backups. See # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-check and # https://borgbackup.readthedocs.org/en/stable/usage.html#borg-extract for details. consistency: # List of one or more consistency checks to run: "repository", # "archives", "data", and/or "extract". Defaults to # "repository" and "archives". Set to "disabled" to disable # all consistency checks. "repository" checks the consistency # of the repository, "archives" checks all of the archives, # "data" verifies the integrity of the data within the # archives, and "extract" does an extraction dry-run of the # most recent archive. Note that "data" implies "archives". checks: - {'name': 'repository', 'frequency': '4 weeks'} - {'name': 'archives', 'frequency': '6 weeks'} # Restrict the number of checked archives to the last n. Applies only to the "archives" check. check_last: 3 # Shell commands or scripts to execute before and after a backup or if an error has occurred. # IMPORTANT: All provided commands and scripts are executed with user permissions of borgmatic. # Do not forget to set secure permissions on this file as well as on any script listed (chmod 0700) to # prevent potential shell injection or privilege escalation. hooks: healthchecks: ping_url: https://healthchecks.io/ping/... ``` #### Environment **borgmatic version:** 1.7.13 **borgmatic installation method:** dnf on Fedora **Borg version:** borg 1.2.4 **Python version:** Python 3.11.3 **operating system and version:** Linux gateway 6.2.15-300.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 11 17:37:39 UTC 2023 x86_64 GNU/Linux
Author

1.7.12 loads the config just fine

1.7.12 loads the config just fine
Owner

Thanks for taking the time to file this and provide the details about your setup. I believe this may be a Fedora-specific issue that this in-progress pull request fixes: #702

I'll close this issue when it's resolved, and in the meantime I recommend you stick with 1.7.12.

Thanks for taking the time to file this and provide the details about your setup. I believe this may be a Fedora-specific issue that this in-progress pull request fixes: https://projects.torsion.org/borgmatic-collective/borgmatic/pulls/702 I'll close this issue when it's resolved, and in the meantime I recommend you stick with 1.7.12.
Owner

The fix has just been released as part of borgmatic 1.7.14! Please let me know if you have any further problems around this.

The fix has just been released as part of borgmatic 1.7.14! Please let me know if you have any further problems around this.
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#703
No description provided.