#967·backrest

CONDITION_SNAPSHOT_START returning error does not trigger hooks (e.g. CONDITION_SNAPSHOT_END)

Author: verybadsoldierCreated Oct 29, 2025Updated Sep 17, 2026
Labelsbug

Describe the bug When running a command hook for CONDITION_SNAPSHOT_START that exits with an error (error code > 0), then no hooks like CONDITION_SNAPSHOT_END or CONDITION_SNAPSHOT_ERROR are being triggered.

To Reproduce Steps to reproduce the behavior:

  1. Define a command hook on CONDITION_SNAPSHOT_START like this:
Image
  1. Content of the script is
write-host

Write-Error aaaaadff

Write-Warning warrrrrnnn

exit 1
  1. Define a command hook on CONDITION_SNAPSHOT_END like this:
Image
  1. Start the backup

  2. The backup will fail due to the exit code of 1 yielded by the snapshot start script.

  3. The end hook is not being triggered. Only the start hook is triggered:

Image

Expected behavior CONDITION_SNAPSHOT_END should always be triggered when a snapshot ends. It should be triggered in the case the snapshot fails due to a fatal exit code in the snapshot start hook.

CONDITION_SNAPSHOT_ERROR should also be triggered if the snapshot start hook yields a fatal error.

In the reproduction steps described above, both events are not triggered.

Platform Info

  • Windows 10 x64
  • Backrest Version: 1.9.2-SNAPSHOT-899f30c