Hyper-V VM VSS backup crash

Hi

I’m trying 2.1.1.100 on Windows Server 2022 to backup VM’s with VSS. Duplicati is installed as a Windows service. Below is the crash log entry in event viewer. Latest vcredist is installed and i’ve tried this on 2 different servers with same result. I’ve tried snapshot-provider=AlphaVSS (instead of default Vanara) with same crash result. It does not look if AlphaVSS is used as in the crash log, Vanara is still referenced. Please advise if any additional logs/info is required.

Thanks

. Application: Duplicati.Server.exe
CoreCLR Version: 8.0.1224.60305
.NET Version: 8.0.12
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Stack:
at Vanara.PInvoke.VssApi.CVssBackupComponents.GetWriterMetadata(Int32)
at ListImplBase<Vanara::PInvoke::VssApi::IVssExamineWriterMetadata ^>.get_Item(Int32)
at ListEnumerator<Vanara::PInvoke::VssApi::IVssExamineWriterMetadata ^>.get_Current()
at System.Linq.Enumerable+SelectEnumerableIterator2[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.ValueTuple2[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at System.Linq.Enumerable.Any[[System.ValueTuple`2[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e],[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<System.Guid,System.__Canon>>, System.Func`2<System.ValueTuple`2<System.Guid,System.__Canon>,Boolean>)
at Duplicati.Library.WindowsModules.VanaraVssBackup.VerifyWriters(System.Guid)
at Duplicati.Library.Snapshots.Windows.SnapshotManager.SetupWriters(System.Guid, System.Guid)
at Duplicati.Library.Snapshots.Windows.HyperVUtility+d__18.MoveNext()
at Duplicati.Library.Snapshots.Windows.HyperVUtility.QueryHyperVGuestsInfo(Duplicati.Library.Snapshots.WindowsSnapshotProvider, Boolean)
at Duplicati.Library.Modules.Builtin.HyperVOptions.RealParseSourcePaths(System.String ByRef, System.String ByRef, System.Collections.Generic.Dictionary`2<System.String,System.String>)
at Duplicati.Library.Modules.Builtin.HyperVOptions.ParseSourcePaths(System.String ByRef, System.String ByRef, System.Collections.Generic.Dictionary`2<System.String,System.String>)
at Duplicati.Library.Main.Controller.SetupCommonOptions(Duplicati.Library.Main.ISetCommonOptions, System.String ByRef, Duplicati.Library.Utility.IFilter ByRef, Duplicati.Library.Main.ControllerMultiLogTarget)
at Duplicati.Library.Main.Controller.RunAction[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]](System.__Canon, System.String ByRef, Duplicati.Library.Utility.IFilter ByRef, System.Func`3<System.__Canon,Duplicati.Library.Main.IBackendManager,System.Threading.Tasks.Task>)
at Duplicati.Library.Main.Controller.Backup(System.String, Duplicati.Library.Utility.IFilter)
at Duplicati.Server.Runner.RunInternal(Duplicati.Server.Database.Connection, Duplicati.Server.EventPollNotify, Duplicati.Library.RestAPI.INotificationUpdateService, Duplicati.WebserverCore.Abstractions.IProgressStateProviderService, Duplicati.WebserverCore.Abstractions.IApplicationSettings, IRunnerData, Boolean)
at Duplicati.Server.Runner.Run(Duplicati.Server.Database.Connection, Duplicati.Server.EventPollNotify, Duplicati.Library.RestAPI.INotificationUpdateService, Duplicati.WebserverCore.Abstractions.IProgressStateProviderService, Duplicati.WebserverCore.Abstractions.IApplicationSettings, Duplicati.Server.Serialization.Interface.IQueuedTask, Boolean)
at Duplicati.WebserverCore.Services.QueueRunnerService+d__22.MoveNext()
at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[[Duplicati.WebserverCore.Services.QueueRunnerService+d__22, Duplicati.WebserverCore, Version=2.1.1.100, Culture=neutral, PublicKeyToken=null]](d__22 ByRef)
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[[Duplicati.WebserverCore.Services.QueueRunnerService+d__22, Duplicati.WebserverCore, Version=2.1.1.100, Culture=neutral, PublicKeyToken=null]](d__22 ByRef)
at Duplicati.WebserverCore.Services.QueueRunnerService.RunTask(Duplicati.Server.Serialization.Interface.IQueuedTask)
at Duplicati.WebserverCore.Services.QueueRunnerService+<>c__DisplayClass21_0.b__0()
at System.Threading.Tasks.Task`1[[System.__Canon, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].InnerInvoke()
at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(System.Threading.Thread, System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef, System.Threading.Thread)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading.PortableThreadPool+WorkerThread.WorkerThreadStart()

Hi @prinskarnatie, welcome to the forum :waving_hand:

We have now managed to reproduce this. It seems to happen only for the query part, so the short-term solution is to switch back the query to use AlphaVSS.

That toggles the provider used to make the actual snapshot. In this case the crash happens when Duplicati asks for the available VMs, which is using VSS but a different provider. Sadly, the query provider cannot be toggled, so it is not possible to fix this with settings.

We are working on a fix for both HyperV and MSSQL that will also add support for these to ngclient.