Order of operations between normalise and override #561
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#561
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
Since commit
02781662f85bcdbab795bf67fdecf28f85cb50d7
thehealthchecks
configuration changed from a simple string to an object. This is backwards compatible within the configuration file because thenormalize
function will upgrade the configuration on-the-fly.However this normalisation happens before overrides are applied (
borgmatic/config/validate.py
), so if you have an override to ping a different Healthcheck (which I currently do before I switch tontfy
) then this will fail "silently" without sending a failure ping because the Healthchecks config is invalidMaybe it would be better to override before normalising so that these dynamic changes can apply in both cases instead of silently failing in one of them?
[borgmatic/config/validate.py](https://projects.torsion.org/borgmatic-collective/borgmatic/src/branch/master/borgmatic/config/validate.py#L101-L102)
Steps to reproduce (if a bug)
Actual behavior (if a bug)
Expected behavior (if a bug)
That the command line
--override
is also normalised in the same way, which makes it compatible withhooks.healthchecks
being an object, not a stringOther notes / implementation ideas
Environment
borgmatic version: 1.6.3
Use
sudo borgmatic --version
orsudo pip show borgmatic | grep ^Version
borgmatic installation method:
pipenv
Borg version: 1.2.1
Use
sudo borg --version
Python version: 3.9.2
Use
python3 --version
Database version (if applicable): n/a
Use
psql --version
ormysql --version
on client and server.operating system and version: Debian 11
Good catch! I apologize for the breakage. I think the solution you suggest (apply overrides before normalization) makes sense. I'd just have to make sure that if you pass in old-style overrides using a new-style configuration file, the override would still replace the existing configuration.
No need to apologise, it's a breakage of my own making since I probably didn't bother reading the release notes last time I upgraded :)
It's just an unfortunate one because the config being invalid means that
borgmatic
never runs, so it won't even send a failure ping. Also that second UUID I set up with Healthchecks doesn't nag every day if the maintenance (check, prune) phases don't run so I hadn't noticed they weren't running for a short while.This is fixed in master and will be part of the next release. Thanks again for reporting it!
This has been released in borgmatic 1.6.6!