Hi Philip,
Thanks for your answer. I performed the steps you described, but unfortunately its still not working - I'm getting different error messages though, so that's something :)
To recap:
- When the Sandbox is not running, the CrmAsyncService logs says:
System.ServiceModel.EndpointNotFoundException: There was no endpoint listening at net.tcp://myserver-fqdn/CrmSandboxHost that could accept the message.
This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
- When the Sandbox is running without SSL (SandboxEnableSSLSecurity = 0), it says:
System.ServiceModel.ProtocolException: The requested upgrade is not supported by 'net.tcp://myserver-fqdn/CrmSandboxHost'.
This could be due to mismatched bindings (for example security enabled on the client and not on the server).
- When the Sandbox is running with SSL (SandboxEnableSSLSecurity = 1 with the thumbprint and host name configured), it says:
System.ServiceModel.CommunicationException: The socket connection was aborted.
This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'.
When I look at the stack trace of the last error (see below), it seems that I got a little further, since it contains a call to "System.Net.Security._SslStream.StartWriting", which tells me that it attempts to write something through SSL, right?
So next question is: why is the socket connection being closed?
Also, another thing I noticed:
When I misconfigure the SandboxSSLCertificateThumbprint, the Sandbox service refuses to start (so it actually uses this registry setting).
However, when I misconfigure the SandboxSSLCertificateDNSName it doesn't seem to care, it starts normally, and in the Windows Event Log viewer, I always see it listening to localhost:
The Sandbox Host service has started.
Source: Microsoft.Crm.Sandbox.HostService.exe (12060)
Endpoint: net.tcp://localhost/CrmSandboxHost
The Sandbox Host service has started.
Source: Microsoft.Crm.Sandbox.HostService.exe (12060)
Endpoint: localhost/CDSSandboxHostStatus
The complete stacktrace of the last error is:
>https://docs.microsoft.com/dotnet/framework/wcf/diagnostics/tracing/System-ServiceModel-Channels-TcpConnectionResetErrorThe socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'. The local IP address and port is [fe80::4525:4189:339a:5825%7]:53493. The remote IP address and port is [fe80::4525:4189:339a:5825%7]:808.CrmAsyncService.exeSystem.ServiceModel.CommunicationException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'. at System.ServiceModel.Channels.SocketConnection.ConvertTransferException(SocketException socketException, TimeSpan timeout, Exception originalException, TransferOperation transferOperation, Boolean aborted, String timeoutErrorString, TransferOperation timeoutErrorTransferOperation, SocketConnection socketConnection, TimeSpan remainingTime)
> at System.ServiceModel.Channels.SocketConnection.ConvertSendException(SocketException socketException, TimeSpan remainingTime, TimeSpan timeout)
> at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
> at System.ServiceModel.Channels.BufferedConnection.WriteNow(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout, BufferManager bufferManager)
> at System.ServiceModel.Channels.BufferedConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
> at System.ServiceModel.Channels.ConnectionStream.Write(Byte[] buffer, Int32 offset, Int32 count)
> at System.Net.Security._SslStream.StartWriting(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
> at System.Net.Security._SslStream.ProcessWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
> at System.Net.Security.SslStream.Write(Byte[] buffer, Int32 offset, Int32 count)
> at System.ServiceModel.Channels.StreamConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
> at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
> at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
> at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
> at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
> at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
> at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
> 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 System.ServiceModel.Channels.ServiceChannelProxy.ExecuteMessage(Object target, IMethodCallMessage methodCall)
> at System.ServiceModel.Channels.ServiceChannelProxy.InvokeChannel(IMethodCallMessage methodCall)
> at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
> at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
> at System.ServiceModel.ICommunicationObject.Open()
> at Microsoft.Crm.Sandbox.SandboxClientBase`1.Open()
> at Microsoft.Crm.Sandbox.SandboxClientBase`1.get_Proxy()
> at Microsoft.Crm.Sandbox.SandboxHostManager.<>c__DisplayClass27_3.b__3()
> at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)
> at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)
> at Microsoft.Crm.Sandbox.SandboxHostManager.<>c__DisplayClass27_0.b__0()
> at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute(ILogger logger, EventId eventId, ActivityType activityType, Action action, IEnumerable`1 additionalCustomProperties)
> at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute(ILogger logger, XrmTelemetryActivityType activityType, Action action)
> at Microsoft.Crm.Sandbox.SandboxHostManager.PingSingleClient(SandboxClient pingClient, SandboxHostInfo info, Boolean useDrawbridgeEnabled)
> at Microsoft.Crm.Sandbox.SandboxHostManager.CreateClientAndPing(SandboxHostInfo info, Boolean useDrawbridgeEnabled)
> at Microsoft.Crm.Sandbox.SandboxHostManager.d__34.MoveNext()
> at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
> at Microsoft.Crm.Sandbox.SandboxHostManager.CheckHostStatus(SandboxHostInfo info, ConcurrentDictionary`2 readyClients, ConcurrentDictionary`2 pendingClients, Boolean useDrawbridgeEnabled)
> at Microsoft.Crm.Sandbox.SandboxHostManager.d__31.MoveNext()
> at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)
> at Microsoft.Crm.Sandbox.SandboxHostManager.PingHostsInternal(Object stateObject)
> at System.Threading.Tasks.Task`1.InnerInvoke()
> at System.Threading.Tasks.Task.Execute()
> 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.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
> at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
> at System.Threading.ThreadPoolWorkQueue.Dispatch()
>System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
> at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
> --- End of inner exception stack trace ---System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089An existing connection was forcibly closed by the remote host at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)System.Net.Sockets.SocketException (0x80004005): An existing connection was forcibly closed by the remote host
> at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)2746