Run-script-before-required: no email in case of error

Set up:

  1. docker container linuxserver/duplicati running on Debian GNU/Linux 12 (Raspberry Pi) as root (PUID 0, GUID 0)
  2. Mount a host volume for scrips
  3. Create a new tiny backup job
  4. Add the option “run-script-before-required” pointing to a script on the host
  5. Add email notification options (global section)

Test 1:
Let the script return zero
Result:
Success, respective email sent

Test 2:
Let the script return non-zero
Result:
Backup job fails as expected with respected notification in the logs
No email sent

Expected result:
Whenever a mandatory script fails, an appropriate email should be sent

This looks like it is to do with the module loading order. The run script module throws a OperationAbortException to stop the backup from running. This is handled correctly and all the OnFinish methods are called, but because the mail module was not configured before, it does nothing. The proper way to fix this would probably be to configure all modules before calling OnStart.

I have made a PR that fixes this.

Sorry to warm this up again. It seems that Changed logic so all modules are loaded before any are started by kenkendk · Pull Request #5245 · duplicati/duplicati · GitHub did get closed without a solution.

I have the same issue:
A script in “run-script-before-required“ checks if the preconditions are met. In case of an error, I see the error in Duplicati, so this works.

I also have setup notifications by HTTP:

send-http-form-urls=https://mydomain.com
send-http-level=Warning,Error,Fatal

But it does not get fired. Since the backup is aborted in case of a pre-script-error, this is kind of a fatal issue and I do not see a way to get notified!!