Borgmatic 2.0 executes commands multiple times #1060
Labels
No labels
blocked
breaking
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#1060
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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
While migrating the borgmatic configs from 1.9.14 to 2.0.1, I ran into the problem with the new hooks.
Steps to reproduce
I am using the
python:3.13-slimcontainer image to reproduce the problem.1.conf2.confActual behavior
When I use
borgmatic==1.9.14, the output isWhen I use
borgmatic==2.0.1, the output isExpected behavior
Borgmatic should not run hooks multiple times.
Other notes / implementation ideas
No response
borgmatic version
2.0.1
borgmatic installation method
pip
Borg version
1.4.0
Python version
Python 3.13.2
Database version (if applicable)
N/A
Operating system and version
Debian 12
Thanks for the detailed ticket and repro steps! I've got a repro here, so I'll let you know what I find.
Wow, this is embarrassing. The whole list of action command hooks get run once for each action that borgmatic's executed with (implicitly or explicitly). That's why you're seeing all the duplication. I don't think I ever noticed this during development because I was mostly manual testing with single actions on the command-line. And the automated tests don't cover this particular use case (yet).
This is fixed in main and will be part of the next release.
Side note: This also uncovered that
actioncommand hooks execute before/after actions listed inskip_actions. That should probably be remedied as well.Thanks again!
Released in borgmatic 2.0.2!