missing finish state ping in case of soft failure #842
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#842
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
I configured borgmatic with a soft failure as the remote machine will be occasionally online. I'm using Healthchecks to monitor my crontabs. When the backups starts, the start state pings Healthchecks. The action successful finishes with the 75 exit code (although no backup was done, as the remote machine is offline). On Healthchecks the check hangs in a in progress state as Healthchecks API received start but no finish. It is possible to adjust the config, so it sends finish to Healthchecks, when it exits with a soft failure?
Steps to reproduce
source_directories:
- /home/user/data/immich/
exclude_patterns:
- /home/user/data/immich/thumbs/
- /home/user/data/immich/encoded-video/
repositories:
- path: ssh://user@192.168.1.223/media/backups/immich-onsite
label: onsite
keep_daily: 7
keep_weekly: 4
keep_monthly: 6
encryption_passphrase: "***"
postgresql_databases:
- name: immich
hostname: 127.0.0.1
port: 5432
username: postgres
password: postgres
pg_dump_command: docker exec immich_postgres pg_dump
healthchecks:
ping_url: http://192.168.1.217:8000/ping/69c42c71-c919-4136-b1d0-228e17b1405d
before_backup:
- ping -q -c 1 192.168.1.223 > /dev/null || exit 75
Actual behavior
/home/user/.config/borgmatic/immich_onsite.yaml: Pinging Healthchecks start
/home/user/.config/borgmatic/immich_onsite.yaml: Running command for pre-backup hook
/home/user/.config/borgmatic/immich_onsite.yaml: Command hook exited with soft failure exit code (75); skipping remaining actions
summary:
/home/user/.config/borgmatic/immich_onsite.yaml: Successfully ran configuration file
Expected behavior
Send finish to Healthcheck app in case of a soft failure exit.
Other notes / implementation ideas
No response
borgmatic version
1.8.9
borgmatic installation method
pipx
Borg version
1.2.7
Python version
3.11.2
Database version (if applicable)
No response
Operating system and version
Debian GNU/Linux 12 (bookworm)
Thanks for taking the time to file this one! What you describe—pinging Healtchecks/monitoring with "finish" in the case of soft failure—seems totally reasonable to me. It's not currently possible to change this behavior in borgmatic's configuration, but IMO it would make sense to change borgmatic's default behavior so that the "finish" state is pinged whenever there's a soft failure.
This is implemented in main and will be part of the next release! Thanks again.
Released in 1.8.10!
Nice. Thank you!