Description
Describe the bug
Backrest has an apparently undocumented behavior where it appends Healthchecks non-success signals (/start
, /fail
, etc.) to the ping URL automatically for conditions such as CONDITION_SNAPSHOT_START
or CONDITION_ANY_ERROR
. (See: https://github.com/garethgeorge/backrest/blob/main/internal/hook/types/healthchecks.go)
This means that passing a run ID as a query parameter will create a badly-formed URL and make the hook fail:
error: sending healthchecks message to "https://hc-ping.com/<my-check-uuid>?rid=<my-run-id>/start": unexpected status 400: 400 Bad Request
running healthchecks hook plan/<my-plan>/hook/2 triggered by CONDITION_SNAPSHOT_START
A workaround is to use a command hook with something like curl <URL>
.
Additionally, this append behavior might also conflict with the exit code functionality in Healthchecks for these conditions.
To Reproduce
Steps to reproduce the behavior:
- Create a Healthchecks hook with a run ID query parameter for a non-success condition.
- Run the hook.
Expected behavior
The hook should create a well-formed URL, either automatically or by making the user input the correct URL manually. An example for the /start
signal:
Healthchecks UUID format:
https://hc-ping.com/<my-check-uuid>/start?rid=<my-run-id>
Healthchecks slug format:
https://hc-ping.com/<my-ping-id>/<my-slug>/start?rid=<my-run-id>
Additionally, it would be useful to alert the user not to append the signal to the URL, if it's going to be inserted automatically.
Platform Info
- OS and Architecture [Microsoft Windows Server 2025 Standard 10.0.26100 Build 26100]
- Backrest Version [1.7.2]