wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Failed to create communication pipe for new CA process. Error code: 231 - async CA #5715

Open rkieslinger opened 6 years ago

rkieslinger commented 6 years ago

WiX v3.11.0.1701

Visual Studio Professional 2017 - v15.4.1

WiX Toolset Visual Studio Extension v0.9.21.62588

.NET 4.7

Windows v10.0 (Build 10586: Service Pack 0)

If you put an asynchronous CA right before a synchronous CA, you will get the following error message on almost every installation:

Failed to create communication pipe for new CA process. Error code: 231

Managed CA (C#)

[CustomAction]
public static ActionResult CA_Async(Session session)
{
    Thread.Sleep(5000);
    return ActionResult.Success;
}

[CustomAction]
public static ActionResult CA_Sync(Session session)
{
    return ActionResult.Success;
}

Wix declaration

<CustomAction Id="CA_Async" Execute="deferred" Impersonate="yes" Return="asyncWait" BinaryKey="CA_binary" DllEntry="CA_Async" />
<CustomAction Id="CA_Sync" Execute="deferred" Impersonate="yes" Return="check" BinaryKey="CA_binary" DllEntry="CA_Sync" />

Installation Execution Sequence

<InstallExecuteSequence>
  <Custom Action="CA_Async" After="InstallInitialize" />
  <Custom Action="CA_Sync" After="CA_Async" />
</InstallExecuteSequence>

There shouldn't be an error.

barnson commented 6 years ago

There might be an issue with globals with the sync/async mix.

andrey-morskoy commented 6 years ago

We have such kind of error even without sync/async mix. It happens occasionally and very rare. The interesting thing about it is that WiX is able to call a few CAs with the same declaration (Return="check" Execute="firstSequence") and then fails with error: SFXCA: Failed to create communication pipe for new CA process. Error code: 231

Here is the piece of the log:

MSI (c) (4C:1C) [16:23:51:215]: Doing action: CheckAppInstalled Action 16:23:51: CheckAppInstalled. Action start 16:23:51: CheckAppInstalled. MSI (c) (4C:A0) [16:23:51:480]: Invoking remote custom action. DLL: C:\Users_\AppData\Local\Temp\MSI5BAA.tmp, Entrypoint: CheckAppInstalled SFXCA: Extracting custom action to temporary directory: C:\Users_\AppData\Local\Temp\MSI5BAA.tmp-\ SFXCA: Binding to CLR version v4.0.30319 Calling custom action PluginInstaller.CustomActions!PluginInstaller.CustomActions.InstallerCustomActions.CheckAppInstalled Action ended 16:23:52: CheckAppInstalled. Return value 1. MSI (c) (4C:1C) [16:23:52:541]: Doing action: CheckAppVersion Action 16:23:52: CheckAppVersion. Action start 16:23:52: CheckAppVersion. MSI (c) (4C:10) [16:23:52:760]: Invoking remote custom action. DLL: C:\Users_\AppData\Local\Temp\MSI60BA.tmp, Entrypoint: CheckAppVersion SFXCA: Failed to create communication pipe for new CA process. Error code: 231 CustomAction CheckAppVersion returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox) Action ended 16:23:52: CheckAppVersion. Return value 3.