Error while parsing a configuration file: Key 'compression' was not defined. Path: '/location' #133

Closed
opened 2019-01-07 10:37:36 +00:00 by anponteg · 4 comments

I installed borgmatic on Arch Linux from AUR: https://aur.archlinux.org/packages/borgmatic/

$ borgmatic --version
1.2.14

If I uncomment compression: lz4 in the configuration file I get an error when I run borgmatic.

Step to reproduce:

Create a borg repository:

$ mkdir /tmp/borgmatic
$ borg init -e none /tmp/borgmatic/test.borg
$ mkdir /tmp/borgmatic/source
$ touch /tmp/borgmatic/source/file

Generate a borgmatic config file: $ generate-borgmatic-config -d /tmp/borgmatic/config.yaml

In /tmp/borgmatic/config.yaml edit only source_directories and repositories:

    source_directories:
        - /tmp/borgmatic/source/
    repositories:
        - /tmp/borgmatic/test.borg

Make a backup with $ borgmatic --config /tmp/borgmatic/config.yaml and it works.

Now edit /tmp/borgmatic/config.yaml and uncomment compression: lz4

Make a backup with $ borgmatic --config /tmp/borgmatic/config.yaml and it doesn't works.

This is the error:

validation.invalid
 --- All found errors ---
["Key 'compression' was not defined. Path: '/location'"]
Errors found but will not raise exception...
config.yaml: Error running configuration file
An error occurred while parsing a configuration file at config.yaml:
Key 'compression' was not defined. Path: '/location'

Need some help? https://torsion.org/borgmatic/#issues
I installed borgmatic on Arch Linux from AUR: https://aur.archlinux.org/packages/borgmatic/ ``` $ borgmatic --version 1.2.14 ``` If I uncomment `compression: lz4` in the configuration file I get an error when I run borgmatic. Step to reproduce: Create a borg repository: ``` $ mkdir /tmp/borgmatic $ borg init -e none /tmp/borgmatic/test.borg $ mkdir /tmp/borgmatic/source $ touch /tmp/borgmatic/source/file ``` Generate a borgmatic config file: `$ generate-borgmatic-config -d /tmp/borgmatic/config.yaml` In `/tmp/borgmatic/config.yaml` edit only `source_directories` and `repositories`: ``` source_directories: - /tmp/borgmatic/source/ ``` ``` repositories: - /tmp/borgmatic/test.borg ``` Make a backup with `$ borgmatic --config /tmp/borgmatic/config.yaml` and it works. Now edit `/tmp/borgmatic/config.yaml` and uncomment `compression: lz4` Make a backup with `$ borgmatic --config /tmp/borgmatic/config.yaml` and it doesn't works. This is the error: ``` validation.invalid --- All found errors --- ["Key 'compression' was not defined. Path: '/location'"] Errors found but will not raise exception... config.yaml: Error running configuration file An error occurred while parsing a configuration file at config.yaml: Key 'compression' was not defined. Path: '/location' Need some help? https://torsion.org/borgmatic/#issues ```

compression is a child of storage (not location as the checker claims).
Did you by any chance forget to uncomment storage? This happened to me last week, too.

`compression` is a child of `storage` (not `location` as the checker claims). Did you by any chance forget to uncomment `storage`? This happened to me last week, too.
Owner

I think @sdellenb is correct here. While the error message could be more helpful, it's basically the validator's way of saying "Uh, there's this key compression in the location section, and I don't expect a compression key there."

Let us know if uncommenting the storage: section fixes this for you.

I think @sdellenb is correct here. While the error message could be more helpful, it's basically the validator's way of saying "Uh, there's this key `compression` in the `location` section, and I don't expect a `compression` key there." Let us know if uncommenting the `storage:` section fixes this for you.
witten added the
question / support
label 2019-01-08 04:25:25 +00:00
Author

Yes, you're right! Thank you very much @sdellenb and @witten!

I uncommented storage: and now it works.

Sorry about that, but I'm new to yaml and I had not noticed the storage: line.

Yes, you're right! Thank you very much @sdellenb and @witten! I uncommented `storage:` and now it works. Sorry about that, but I'm new to yaml and I had not noticed the `storage:` line.
Owner

No worries! Glad that did it.

No worries! Glad that did it.
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#133
No description provided.