Duplicati server is crashing at tail end of backup. Need help determining what went wrong

I’ve been receiving this error on 2.0.4.3 and 2.0.5.1:

$ /usr/bin/mono-sgen /usr/share/Duplicati/updates/2.0.5.1/Duplicati.Server.exe
* Assertion at local-propagation.c:330, condition `ins->opcode > MONO_CEE_LAST' not met

Stacktrace:
at <unknown> <0xffffffff>
at System.Collections.Generic.Dictionary`2<string, int>.Insert (string,int,bool) <0x0006b>
at System.Collections.Generic.Dictionary`2<string, int>.Add (string,int) <0x0001b>
at MimeKit.Utils.CharsetUtils.AddAliases (System.Collections.Generic.Dictionary`2<string, int>,int,int,string[]) <0x0006c>
at MimeKit.Utils.CharsetUtils..cctor () <0x002b3>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x00062>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) object.__icall_wrapper_mono_generic_class_init (intptr) <0x00059>
at MimeKit.ParserOptions..ctor () <0x000cf>
at MimeKit.ParserOptions..cctor () <0x0007b>
at (wrapper runtime-invoke) object.runtime_invoke_void (object,intptr,intptr,intptr) <0x00062>
at <unknown> <0xffffffff>
at Duplicati.Library.Modules.Builtin.SendMail.SendMessage (string,string) <0x00157>
at Duplicati.Library.Modules.Builtin.ReportHelper.OnFinish (object) <0x00772>
at Duplicati.Library.Main.Controller.OnOperationComplete (object) <0x002a3>
at Duplicati.Library.Main.Controller.RunAction<T_REF> (T_REF,string[]&,Duplicati.Library.Utility.IFilter&,System.Action`1<T_REF>) <0x00747>
at Duplicati.Library.Main.Controller.Backup (string[],Duplicati.Library.Utility.IFilter) <0x002fb>
at Duplicati.Server.Runner.Run (Duplicati.Server.Runner/IRunnerData,bool) <0x01193>
at Duplicati.Server.Program/<>c.<SetWorkerThread>b__45_0 (Duplicati.Server.Runner/IRunnerData) <0x00017>
at Duplicati.Library.Utility.WorkerThread`1<Tx_REF>.Runner () <0x005da>
at System.Threading.ThreadHelper.ThreadStart_Context (object) <0x00099>
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x00178>
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) <0x00020>
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) <0x00059>
at System.Threading.ThreadHelper.ThreadStart () <0x0002e>
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0x000d1>

What’s most interesting is this one "Duplicati.Library.Modules.Builtin.SendMail.SendMessage. Any tips on how to debug this further?

What version of mono do you have? Another user reported an issue like this and it was caused by an old mono version. Duplicati 2.0.5.x requires mono 5.0 or higher.

$ mono --version
Mono JIT compiler version 4.6.2 (Debian 4.6.2.7+dfsg-1ubuntu1)

I’ll retry soon with an updated mono version. What’s odd is that this bug just started happening in the last 3 weeks.