Potential Bug - Email Not Sent When Backup Fails Due to Destination Offline

My destination was offline yesterday, so my backups failed. Looking at the Duplicati logs it properly retried using the settings I had defined, but when it ultimately gave up I would have expected it to have sent an email.

Log:

Fatal error
System.Net.Sockets.SocketException (0x80004005): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Email Setting:

--send-mail-level=Warning,Error,Fatal

Let me know if my assumption that it would email is wrong, or if I’ve missed a setting somewhere.

That’s odd - I get an email with the body below when my USB drive isn’t attached, though it could certainly be a different scenario due to the local storage.

Oh - and I don’t know that I have retries set. I’ll try to check those settings when I get on that machine in a few hours…

Failed: The folder /Volumes/MyBackups/Duplicati/MyMac/ does not exist
Details: Duplicati.Library.Interface.FolderMissingException: The folder /Volumes/MyBackups/Duplicati/MyMac/ does not exist
  at Duplicati.Library.Main.BackendManager.List () [0x00038] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Operation.FilelistProcessor.RemoteListAnalysis (Duplicati.Library.Main.BackendManager backend, Duplicati.Library.Main.Options options, Duplicati.Library.Main.Database.LocalDatabase database, Duplicati.Library.Main.IBackendWriter log, System.String protectedfile) [0x0000d] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList (Duplicati.Library.Main.BackendManager backend, Duplicati.Library.Main.Options options, Duplicati.Library.Main.Database.LocalDatabase database, Duplicati.Library.Main.IBackendWriter log, System.String protectedfile) [0x00000] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify (Duplicati.Library.Main.BackendManager backend, System.String protectedfile) [0x000fd] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x00860] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Controller+<>c__DisplayClass16_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x0030f] in <118ad25945a24a3991f7b65e7a45ea1e>:0
  at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x00072] in <118ad25945a24a3991f7b65e7a45ea1e>:0

I think it should have sent an email. But if the network was down, it could not have sent the email (it could not reach the email server).

Good point, but I would expect to see a “failure sending email” type log entry in that case.

Only the destination was offline so it should have sent an email.

I spent some time recreating the destination down and figured out why I didn’t get an email. I didn’t realize that you have to explicitly tell Duplicati to NOT use StartTLS even when using port 25. I swear I tested sending emails early on and didn’t have any issues. In any case updating my --send-mail-url to “smtp://smtpserver.com:25/?starttls=never” fixed it.

I didn’t catch the issue earlier because I had only looked at the job specific log, which showed the retries and ultimate failure but didn’t catch the SMTP errors, and I had checked the server level “stored” log which showed the same, but I had to watch it live with “profiling” to see the failure to send the email.