Wednesday, October 3, 2018

The plug-in execution failed because the Sandbox Client encountered an error during initialization.


There are certain out-of-box Dynamic CRM plugins, which executed by CRM Sandbox Service only. I came to know about one such scenario where I was changing the security role of a user in dynamic CRM and an exception message flashes on screen.

I would like to share my investigation here so that we have a structured approach to resolve an issue.

This is for CRM 2016 On-Premise….

Other Similar exception message you might encountered

The plug-in execution failed because no Sandbox Hosts are currently available. Please check that you have a Sandbox server configured and that it is running.


In the Event Viewer, I was getting following exceptions for SOURCE : MSCRMSandboxClient

The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: failed to start the service (5). Refer to the Event Log for more details.
   at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.HandleServiceStart(Boolean isReconnecting)

There was no endpoint listening at net.pipe://localhost/CrmSandboxHost that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. ---> System.IO.PipeException: The pipe endpoint 'net.pipe://localhost/CrmSandboxHost' could not be found on your local machine.

System.ServiceModel.CommunicationObjectFaultedException: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.

The Sandbox SDK Listener failed to start.
 Source: w3wp.exe (5156)
 Endpoint: net.tcp://localhost/CrmSandboxSdkListener-w3wp
 Error: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: failed to start the service (5). Refer to the Event Log for more details.

Step-By-Step Verification and Solution

Verify if Microsoft Dynamics CRM Sandbox Processing Service (MSCRMSandboxService) is up and running on CRM Web Server. 
If you have a load-balanced environment then we need to verify on each hosted application server.



You can try to restart Sandbox Services (each on hosted server) and verify if the error is still occurring. If not then jump to next solutions.

Preferred Method : Specify host names in CRM Web Application server
regedit -> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\MSV1_0
1.    Right-click MSV1_0, point to New, and then click Multi-String Value.
2.    Type BackConnectionHostNames, and then press ENTER.
3.    Right-click BackConnectionHostNames, and then click Modify.
4.    In the Value data box, type the host name or the host names for the sites that are on the local computer, and then click OK. Separate each entry with a new line.

Less Recommended Method : Disable the loopback check
regedit -> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
1.    Right-click Lsa, point to New, and then click DWORD Value.
2.    Type DisableLoopbackCheck, and then press ENTER.
3.    Right-click DisableLoopbackCheck, and then click Modify.
4.    In the Value data box, type 1, and then click OK.

Method : Modifying the IIS Maximum Worker Processes

In IIS, right-click on Application Pool, select Advance Settings, and in the Process Model section, you will have “Maximum Worker Processes”. Edit the value to "1". 

Note & Tips:
Quit Registry Editor, and then restart the IISAdmin service.
Run ipconfig /all in the command prompt to check for a host name.
For a detailed understanding and cause about these issues refer below MSDN blogs


No comments: