missing finish state ping in case of soft failure #842

Closed
opened 2024-03-18 19:49:55 +00:00 by aspik · 4 comments

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)

### 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)
Owner

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.

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.
Owner

This is implemented in main and will be part of the next release! Thanks again.

This is implemented in main and will be part of the next release! Thanks again.
Owner

Released in 1.8.10!

Released in 1.8.10!
Author

Nice. Thank you!

Nice. Thank you!
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#842
No description provided.