Microsoft.Deployment.WindowsInstaller.InstallerException: Cannot access session details from a non-immediate custom action

I am trying to install Invantive Query Tool to load data from files into Odoo on a Windows Server 2022 Standard (21H2, 20348.1906) with 256 GB of memory. Microsoft .net 4.8 roles are active.

Besides the Windows Firewall there is solely Bitdefender Endpoint active.

Installation fails:

The installation fails and the log file contains:

...
ActionStart: Action 12:54:49: PublishProduct. Publishing product information
ActionData: 1: {47133204-FFF9-4A76-AF75-30BA70014700} 
ActionStart: Action 12:54:49: CancelRequestHandler. 
Info: SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIF4F8.tmp-\
Info: SFXCA: Binding to CLR version v4.0.30319
Info: Calling custom action WixSharp!WixSharp.ManagedProjectActions.CancelRequestHandler
ActionStart: Action 12:54:49: MaintainIiidBIFCA. 
Info: SFXCA: Extracting custom action to temporary directory: C:\Windows\Installer\MSIF631.tmp-\
Info: SFXCA: Binding to CLR version v4.0.30319
Info: Calling custom action Invantive.Deploy.CA!Invantive.Deploy.CA.CustomActions.MaintainIiidBIFCA
Info: Exception thrown by custom action:
Info: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.Deployment.WindowsInstaller.InstallerException: Cannot access session details from a non-immediate custom action
   at Microsoft.Deployment.WindowsInstaller.Session.ValidateSessionAccess()
   at Microsoft.Deployment.WindowsInstaller.Session.get_Item(String property)
   at (Object , String )
   at SIDY.RBL.M(Object , String )
   at Invantive.Deploy.Runtime.LogUtility.HandleException(Session session, Exception ex)
   at SIDY.POC.M(Session , Exception )
   at Invantive.Deploy.CA.CustomActions.MaintainIiidBIFCA(Session session)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object parameters, Object arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture)
   at Microsoft.Deployment.WindowsInstaller.CustomActionProxy.InvokeCustomAction(Int32 sessionHandle, String entryPoint, IntPtr remotingDelegatePtr)
Info: CustomAction MaintainIiidBIFCA returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)
Info: Action ended 12:54:50: InstallFinalize. Return value 3.
CommonData: Message type: 2, Argument: 0
CommonData: Message type: 2, Argument: 0
CommonData: Message type: 0, Argument: 1033
CommonData: Message type: 1, Argument: Invantive Query Tool 23.0
ActionStart: Action 12:54:50: Rollback. Rolling back action:
ActionData: MaintainIiidBIFCA
ActionData: CancelRequestHandler
ActionData: Publishing product information
ActionData: Publishing Product Features
ActionData: NetFxExecuteNativeImageCommitInstall
ActionData: NetFxExecuteNativeImageCommitUninstall
ActionData: Registering product
ActionData: Writing system registry values
ActionData: Creating shortcuts
ActionData: WixSharp_AfterInstall_Action
ActionData: Copying new files
ActionData: Creating folders
ActionData: Updating component registration
CommonData: Message type: 2, Argument: 1
CommonData: Message type: 2, Argument: 1
Info: Action ended 12:54:52: INSTALL. Return value 3.
InstallEnd: 1: Invantive Query Tool 23.0 2: {47133204-FFF9-4A76-AF75-30BA70014700} 3: 3 
CommonData: 1: 2 2: 0 
CommonData: 1: 2 2: 1 
Info: Action ended 12:54:52: INSTALL. Return value 3.

CustomAction MaintainIiidBIFCA returned actual error code 1603.

On Invantive Control 23.0.18 the error is:

image

Invantive Control for Excel Setup-Assisten wurde vorzeitig beendet

with the same error in the log file.

Instalaltion of Invantive Control 22.0.705 was previously down and successful.

The regular sequence is after MaintainIiidBIFCA on another Server 2022 instance:

Info: Calling custom action Invantive.Deploy.CA!Invantive.Deploy.CA.CustomActions.MaintainIiidBIFCA
CommonData: Message type: 2, Argument: 0
ActionStart: Action 11:26:11: RollbackCleanup. Removing backup files
Info: ExecNetFx:  Microsoft (R) CLR Native Image Generator - Version 4.8.4380.0
Info: ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
Info: ExecNetFx:  Microsoft (R) CLR Native Image Generator - Version 4.8.4380.0
Info: ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
...repeat 100 times
Info: ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
Info: ExecNetFx:  Microsoft (R) CLR Native Image Generator - Version 4.8.4380.0
Info: ExecNetFx:  Copyright (c) Microsoft Corporation.  All rights reserved.
ActionData: File: C:\Config.Msi\22d2b.rbf
ActionData: File: C:\Config.Msi\22d2c.rbf
ActionData: File: C:\Config.Msi\22d2d.rbf
CommonData: Message type: 2, Argument: 1
Info: Action ended 11:26:43: InstallFinalize. Return value 1.
Info: Action ended 11:26:43: INSTALL. Return value 1.
InstallEnd: 1: Invantive Runtime 23.0 2: {B20D19BE-E9DE-4381-94AF-319370014700} 3: 1 
CommonData: 1: 2 2: 0 
CommonData: 1: 2 2: 1 
Info: Action ended 11:26:43: INSTALL. Return value 1.

With dbgview running in parallel, more details became clear.

The problem seems to be that the stack trace used for error reporting and analysis could not be determined as signaled by “Zugriff verweigert” (itgenmsi502), leading to more errors.

The stack trace was collected due to another error when setting the security TLS protocol to 1.3, but also at least 5 different errors.

As a first solution, the installer has been adapted to ignore a failure determining call stack. The next release will provide better insight in to the issues.

Weirdly enough, thes issues did not occur on another fresh Server 2022, in this case on AWS.

2023-09-07 11:36:07.090: itgenmsi329: Untranslated UIText:ProductCode={545C8CC7-C52B-4ABA-9C4F-EBECA8FC9E23} 	
2023-09-07 11:36:07.090: itgenmsi329: Untranslated UIText:ProductVersion=23.0.18 	
2023-09-07 11:36:07.979: itgenmsi501: First chance exception handling of type 'Win32Exception': 	
2023-09-07 11:36:07.979: itgenmsi502: Zugriff verweigert 	
2023-09-07 11:36:07.989: itgenmsi504: Stack trace: 	
2023-09-07 11:36:07.989: itgenmsi505:    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo) 	
   at System.Environment.get_StackTrace() 	
   at SIDY.QN.M() 	
   at Invantive.Deploy.Error.CurrentDomain_FirstChanceException(Object sender, FirstChanceExceptionEventArgs e) 	
   at System.Diagnostics.ProcessManager.OpenProcess(Int32 processId, Int32 access, Boolean throwIfExited) 	
   at System.Diagnostics.NtProcessManager.GetModuleInfos(Int32 processId, Boolean firstModuleOnly) 	
   at System.Diagnostics.NtProcessManager.GetFirstModuleInfo(Int32 processId) 	
   at System.Diagnostics.Process.get_MainModule() 	
   at System.Net.RegistryConfiguration.GetAppConfigValueName() 	
   at System.Net.RegistryConfiguration.AppConfigReadInt(String configVariable, Int32 defaultValue) 	
   at System.Net.ServicePointManager.LoadUseHttpPipeliningAndBufferPoolingConfiguration(Boolean useFeature) 	
   at System.Net.ServicePointManager.TryInitialize[T](Func`2 loadConfiguration, T fallbackDefault) 	
   at System.Net.ServicePointManager.LoadConfiguration() 	
   at System.Net.ServicePointManager.EnsureConfigurationLoaded() 	
   at System.Net.ServicePointManager.get_SecurityProtocol() 	
   at SIDY.KNL.M() 	
   at Invantive.Deploy.Runtime.CustomerServiceUtility.ConfigureSecurityProtocol() 	
   at SIDY.UIL.M() 	
   at Invantive.Deploy.Runtime.CustomerServiceUtility.M(String , OfficeUserInformation , List`1 , String , String , String , String , Boolean , Boolean , String ) 	
   at Invantive.Deploy.Runtime.SystemUtility.IsBusinessEmailAddress(String emailAddress, Boolean verifyRfcConformance, Boolean verifyMxRecord, Boolean verifyARecord, Boolean allowNonBusiness, Boolean allowTemporary, Boolean allowAnonymous, String externalIpAddressV6Requester, String languageCode) 	
   at SIDY.EQL.M(String , Boolean , Boolean , Boolean , Boolean , Boolean , Boolean , String , String ) 	
   at Invantive.Deploy.Runtime.SystemUtility.GetUserDiscoveredEmailAddresses(Boolean allowNonBusiness, Boolean allowTemporary, Boolean allowAnonymous) 	
   at SIDY.QHL.M(Boolean , Boolean , Boolean ) 	
   at Invantive.Deploy.Runtime.StaticValues.N() 	
   at Invantive.Deploy.Runtime.StaticValues.SetupFromSessionAndLoad(ISession session, String messageCode, String messageText) 	
   at SIDY.PGN.M(ISession , String , String ) 	
   at Invantive.Deploy.UI.WelcomeDialog.M(Object , EventArgs ) 	
   at System.Windows.Forms.Form.OnLoad(EventArgs e) 	
   at System.Windows.Forms.Form.OnCreateControl() 	
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 	
   at System.Windows.Forms.Control.CreateControl() 	
   at System.Windows.Forms.Control.WmShowWindow(Message& m) 	
   at System.Windows.Forms.Control.WndProc(Message& m) 	
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 	
   at System.Windows.Forms.Form.WmShowWindow(Message& m) 	
   at System.Windows.Forms.Form.WndProc(Message& m) 	
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 	
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 	
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 	
   at System.Windows.Forms.UnsafeNativeMethods.SetParent(HandleRef hWnd, HandleRef hWndParent) 	
   at System.Windows.Forms.Control.SetParentHandle(IntPtr value) 	
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) 	
   at System.Windows.Forms.Control.CreateControl() 	
   at System.Windows.Forms.Control.WmShowWindow(Message& m) 	
   at System.Windows.Forms.Control.WndProc(Message& m) 	
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m) 	
   at System.Windows.Forms.Form.WmShowWindow(Message& m) 	
   at System.Windows.Forms.Form.WndProc(Message& m) 	
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) 	
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) 	
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) 	
   at System.Windows.Forms.SafeNativeMethods.ShowWindow(HandleRef hWnd, Int32 nCmdShow) 	
   at System.Windows.Forms.Control.SetVisibleCore(Boolean value) 	
   at System.Windows.Forms.Form.SetVisibleCore(Boolean value) 	
   at System.Windows.Forms.Control.set_Visible(Boolean value) 	
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) 	
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) 	
   at System.Windows.Forms.Application.RunDialog(Form form) 	
   at System.Windows.Forms.Form.ShowDialog(IWin32Window owner) 	
   at System.Windows.Forms.Form.ShowDialog() 	
   at WixSharp.UIShell.ShowModal(InstallerRuntime runtime, IManagedUI ui) 	
   at WixSharp.ManagedUI.<>c__DisplayClass31_1.<Initialize>b__0() 	
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state) 	
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 	
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) 	
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 	
   at System.Threading.ThreadHelper.ThreadStart() 	

This question was automatically closed after at least 2 weeks of inactivity after a possible solution was provided. The last answer given has been marked as a solution.

Please ask a new question via a separate topic if the problem occurs again. Please include a link to this topic in the new question by pasting its URL into the text.

Dit topic is 7 dagen na het laatste antwoord automatisch gesloten. Nieuwe antwoorden zijn niet meer toegestaan.