"Failure has occurred while loading a type. " error during backup on osx

After deleting my local database and my backup (due to Unexpected difference in fileset version 4: ...found 6180 entries, but expected 6181) I’m now getting the following error when running the backup

* Aug 14, 2020 11:27 AM: The operation Backup has failed with error: Failure has occurred while loading a type. 
{"ClassName":"System.TypeLoadException","Message":"Failure has occurred while loading a type.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":"  at Duplicati.Library.Encryption.EncryptionBase.Encrypt (System.IO.Stream input, System.IO.Stream output) [0x00000] in <6df07cc5452c450cb3c3854d714fdd41>:0 \n  at Duplicati.Library.Encryption.EncryptionBase.Encrypt (System.String inputfile, System.String outputfile) [0x0000e] in <6df07cc5452c450cb3c3854d714fdd41>:0 \n  at Duplicati.Library.Main.Operation.Common.BackendHandler+FileEntryItem.Encrypt (Duplicati.Library.Main.Options options) [0x0003b] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n  at Duplicati.Library.Main.Volumes.VolumeWriterBase.CreateFileEntryForUpload (Duplicati.Library.Main.Options options) [0x00018] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n  at Duplicati.Library.Main.Operation.Backup.DataBlockProcessor+<>c__DisplayClass0_0+<<Run>b__0>d.MoveNext () [0x004aa] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at Duplicati.Library.Main.Operation.Backup.DataBlockProcessor+<>c__DisplayClass0_0+<<Run>b__0>d.MoveNext () [0x006c4] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at CoCoL.AutomationExtensions+<RunTask>d__10`1[T].MoveNext () [0x00083] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at Duplicati.Library.Main.Operation.BackupHandler+<RunMainOperation>d__13.MoveNext () [0x0035f] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0004e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x0002e] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x0000b] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at Duplicati.Library.Main.Operation.BackupHandler+<RunAsync>d__20.MoveNext () [0x00a16] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n--- End of stack trace from previous location where exception was thrown ---\n  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <dca3b561b8ad4f9fb10141d81b39ff45>:0 \n  at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x00050] in <9a758ff4db6c48d6b3d4d0e5c2adf6d1>:0 \n  at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter, System.Threading.CancellationToken token) [0x00009] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n  at Duplicati.Library.Main.Controller+<>c__DisplayClass14_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x0004b] in <9d37c106a6af4e2db9ebdc93583bad34>:0 \n  at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x0011c] in <9d37c106a6af4e2db9ebdc93583bad34>:0 ","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2146233054,"Source":"mscorlib","TypeLoadClassName":null,"TypeLoadAssemblyName":null,"TypeLoadMessageArg":null,"TypeLoadResourceID":0}
* Aug 14, 2020 11:27 AM: Running Backup took 0:00:10:35.116
* Aug 14, 2020 11:27 AM: ExecuteNonQuery: PRAGMA optimize took 0:00:00:00.000
* Aug 14, 2020 11:27 AM: Starting - ExecuteNonQuery: PRAGMA optimize
* Aug 14, 2020 11:27 AM: Fatal error

I’m using version “2.0.5.110_canary_2020-08-10” on osx. It only happens when using encryption. Without encryption this does not happen.

I’ve created Failure has occurred while loading a type error during backup on osx · Issue #4286 · duplicati/duplicati · GitHub as I guess that this is a bug. Should/can I delete this thread?

Which encryption? AES? I haven’t heard of any other Mac users encountering this so perhaps there’s something unique about your install/environment.

Yes AES. For me it sounds like a regression introduced with 2.0.5.110 as it was working fine with one of the previous releases (I think the last successful backup was with v2.0.5.108-2.0.5.108_canary_2020-07-09).

Maybe it was introduced with the following change in the Release v2.0.5.109-2.0.5.109_canary_2020-08-07 · duplicati/duplicati · GitHub release?

  • Updated to use and require .Net 4.7.1, thanks @warwickmm

I’m running duplicati as a service on osx and updated using the internal updater. I’ll try ot do a clean re-install (I just have to figure out how I managed to get it running as a service in the first place :))

I got it working again after

That could be it. .Net 4.7.1 requires mono 5.10 or greater.