A command hook with the "finish" state gets run even when "borg --version" fails #1100
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1100
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
I'm trying to repro #1099, so I can update the docs accordingly.
Steps to reproduce
I created a configuration file with command hooks as follows:
Then to test the failure case, I intentionally used a non-existent
local_path:Actual behavior
When I ran borgmatic, and the expected error occurred, the command hook that was restricted to the
finishstate still ran:Expected behavior
Any
finishstate command hooks should not run when an error occurs.Other notes / implementation ideas
Fortunately, this bug appears to be restricted to the specific case of
borg --versionfailing. That's because when such an error occurs inrun_configuration(), there's areturninstead of araise. And therefore the state gets considered afinishinstead of afail. The fix is probably to change thatreturnto araise.borgmatic version
main
borgmatic installation method
pipx install --editable
Borg version
1.4.1
Python version
3.13.3
Database version (if applicable)
No response
Operating system and version
Manjaro stable
Fixed in main and will be part of the next release.
Released in borgmatic 2.0.7!