Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Sandbox mode and Frontend/Backend deployment

(1) ShareShare
ReportReport
Posted on by 241

We have CRM 365 v9 on-premise. We have plugins(Sandbox mode) that work on our DEV sever (frontend/backend on the same server). But they do not work on our TEST environment because Test environment has frontend and backend on different servers. If I change the plugin to non-sandbox mode it will work. So seems like combination of Sandbox and frontend/backend on different servers is the cause.  Help? thanks

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect
   --- End of inner exception stack trace ---
   at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
   at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
   at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)
   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)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   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.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #0DFC3B2ADetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
  <ActivityId>2656299e-26f7-44c7-9b3a-c1a1a0d4f340</ActivityId>
  <ErrorCode>-2147204345</ErrorCode>
  <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
  <Message>System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---&gt; System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---&gt; System.ComponentModel.Win32Exception: The target principal name is incorrect
   --- End of inner exception stack trace ---
   at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)
   at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty&amp; remoteSecurity)
   --- End of inner exception stack trace ---

Server stack trace:
   at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty&amp; remoteSecurity)
   at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)
   at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection&amp; connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper&amp; timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper&amp; timeoutHelper)
   at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper&amp; 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)

Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; 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.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #0DFC3B2A</Message>
  <Timestamp>2019-06-25T14:52:52.5569236Z</Timestamp>
  <ExceptionRetriable>false</ExceptionRetriable>
  <ExceptionSource i:nil="true" />
  <InnerFault i:nil="true" />
  <OriginalException i:nil="true" />
  <TraceText>

*This post is locked for comments

  • Holly Li Profile Picture
    241 on at
    RE: Sandbox mode and Frontend/Backend deployment

    Thanks. Radu.

    You remind me, I changed http/crm365v9-fe-t to http/crm365v9-fe-t.company.org for appPool account it then works.

  • Radu Chiribelea Profile Picture
    6,667 on at
    RE: Sandbox mode and Frontend/Backend deployment

    looks to be OK - yet i don't think you'd need this SPN  http/crm365v9-be-t against the CRMAppPool

    Can you also check if you have any duplicates : setspn -x

  • Holly Li Profile Picture
    241 on at
    RE: Sandbox mode and Frontend/Backend deployment

    I have thought of that but couldn't figure out what is wrong with SPN setting.

    Our machine setup is: frontend is on crm365v9-fe-t, backend is crm364v9-be-t. We access our CRM using https://crmtest.company.edu

    Here are the SPNs:

    Frontend Server:

    C:\Windows\system32>setspn -L crm365v9-fe-t

    Registered ServicePrincipalNames for CN=CRM365V9-FE-T...

           RestrictedKrbHost/crmtest.company.edu (I added this. Not sure if I should but it didn't affect anything)

           HOST/crmtest.company.edu (I added this)

           TERMSRV/CRM365V9-FE-T

           TERMSRV/CRM365v9-FE-T.company.org

           WSMAN/CRM365v9-FE-T.company.org

           WSMAN/CRM365v9-FE-T

           RestrictedKrbHost/CRM365V9-FE-T

           HOST/CRM365V9-FE-T

           RestrictedKrbHost/CRM365v9-FE-T.company.org

           HOST/CRM365v9-FE-T.company.org

    Sandbox Account:

    C:\Windows\system32>setspn -L company\_svccrmdev2016sand

    Registered ServicePrincipalNames for CN=_svcCRMDev2016Sand ...

           MSCRMSandboxService/CRM365v9-BE-T.company.org

    App pool account:

    C:\Windows\system32>setspn -L company\_svccrmdev2016

    Registered ServicePrincipalNames for CN=_svcCRMDev2016...

           http/crm365v9-be-t

           http/crm365v9-fe-t

           http/crmtest.company.edu

    Any problem?

    Thanks

    Holly Li

  • Suggested answer
    Radu Chiribelea Profile Picture
    6,667 on at
    RE: Sandbox mode and Frontend/Backend deployment

    Hello,

    Based on the error you are seeing seems to be an SPN issue.

    Can you check the SPNs configured against your CrmAppPool Account - setspn -l domain\crmapppoolaccount

    Please check following article for more details on setting the SPNs cloudblogs.microsoft.com/.../configuring-service-principal-names

    Regards,

    Radu

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans