MongoDB Hook not found #526

Closed
opened 2022-05-04 15:56:41 +00:00 by aditzend · 3 comments

I am trying to configure mongodb_databases hook

Steps to reproduce

contents of /etc/borgmatic/config.yaml (sanitized)

location:
    source_directories: []
    repositories:
        - xxx@yyy.repo.borgbase.com:repo
storage:
    encryption_passphrase: "zzz"

retention:
    keep_daily: 7
    keep_monthly: 2
hooks:
    mongodb_databases:
        - name: all
          hostname: localhost
          port: 27017
          username: backup
          password: xxx
          authentication_database: admin
    mysql_databases:
        - name: all
          hostname: localhost
          port: 1234
          username: backup
          password: xxx

then I run the command

borgmatic --verbosity 2 --files

Actual behavior

validation.invalid
 --- All found errors ---
["Key 'mongodb_databases' was not defined. Path: '/hooks'"]
Errors found but will not raise exception...
Ensuring legacy configuration is upgraded
/etc/borgmatic/config.yaml /etc/borgmatic.d /root/.config/borgmatic/config.yaml /root/.config/borgmatic.d: No configuration files found

summary:
/etc/borgmatic/config.yaml: Error parsing configuration file
An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml:
Key 'mongodb_databases' was not defined. Path: '/hooks'
/etc/borgmatic/config.yaml /etc/borgmatic.d /root/.config/borgmatic/config.yaml /root/.config/borgmatic.d: No configuration files found

Need some help? https://torsion.org/borgmatic/#issues

Expected behavior

Command should have performed a backup

Other notes / implementation ideas

MongoDb Command Line Tools installed

mongodump version: 100.5.2
git version: e2842eb549308c16e070fb2e197d4631cfd085cb
Go version: go1.16.7
   os: linux
   arch: amd64
   compiler: gc

MongoDB Version 5.0.7

Environment

borgmatic version: 1.5.1

borgmatic installation method: Debian package

Borg version: borg 1.1.15

Python version: Python 3.8.10

Database version (if applicable): MongoDB 5.7.0

operating system and version: Ubuntu 20.04

#### I am trying to configure mongodb_databases hook #### Steps to reproduce contents of /etc/borgmatic/config.yaml (sanitized) ``` location: source_directories: [] repositories: - xxx@yyy.repo.borgbase.com:repo storage: encryption_passphrase: "zzz" retention: keep_daily: 7 keep_monthly: 2 hooks: mongodb_databases: - name: all hostname: localhost port: 27017 username: backup password: xxx authentication_database: admin mysql_databases: - name: all hostname: localhost port: 1234 username: backup password: xxx ``` then I run the command `borgmatic --verbosity 2 --files` #### Actual behavior ``` validation.invalid --- All found errors --- ["Key 'mongodb_databases' was not defined. Path: '/hooks'"] Errors found but will not raise exception... Ensuring legacy configuration is upgraded /etc/borgmatic/config.yaml /etc/borgmatic.d /root/.config/borgmatic/config.yaml /root/.config/borgmatic.d: No configuration files found summary: /etc/borgmatic/config.yaml: Error parsing configuration file An error occurred while parsing a configuration file at /etc/borgmatic/config.yaml: Key 'mongodb_databases' was not defined. Path: '/hooks' /etc/borgmatic/config.yaml /etc/borgmatic.d /root/.config/borgmatic/config.yaml /root/.config/borgmatic.d: No configuration files found Need some help? https://torsion.org/borgmatic/#issues ``` #### Expected behavior Command should have performed a backup #### Other notes / implementation ideas MongoDb Command Line Tools installed ``` mongodump version: 100.5.2 git version: e2842eb549308c16e070fb2e197d4631cfd085cb Go version: go1.16.7 os: linux arch: amd64 compiler: gc ``` MongoDB Version 5.0.7 #### Environment **borgmatic version:** 1.5.1 **borgmatic installation method:** Debian package **Borg version:** borg 1.1.15 **Python version:** Python 3.8.10 **Database version (if applicable):** MongoDB 5.7.0 **operating system and version:** Ubuntu 20.04
Owner

The MongoDB hook was added in borgmatic 1.5.22. So it looks like it's time to upgrade if you'd like to use it! Alternatively, if you can't upgrade for whatever reason, you can manually dump the database yourself within borgmatic's before_backup hook.

Hope that helps!

The MongoDB hook was added in borgmatic 1.5.22. So it looks like it's time to upgrade if you'd like to use it! Alternatively, if you can't upgrade for whatever reason, you can manually dump the database yourself within borgmatic's `before_backup` hook. Hope that helps!
witten added the
question / support
label 2022-05-04 16:11:02 +00:00
Author

Great! I installed borgmatic with apt and the last version there is 1.5.1. Installing it again with pip got me 1.6.0 which works like a charm, thanks a lot!

Great! I installed borgmatic with apt and the last version there is 1.5.1. Installing it again with pip got me 1.6.0 which works like a charm, thanks a lot!
Owner

Awesome, glad to hear it!

Awesome, glad to hear it!
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#526
No description provided.