Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

Posted on by Microsoft Employee

Hello,

I have been trying to connect to our clients' CRM 2016 organizations using the PluginRegistrationTool We have 5 organizations created with the same Deployment Manager, using the same SQL server, the same Front End server as well as the same Back End Server. The version on the CRM organizations are 8.2.5.4. I have used the 8.X version of the PRT to connect to all but one of these orgs in the past. Updates were installed 6/24, but I cannot verify if that was when the issue started. The orgs also all use the same AD FS 3.0 for their IFD/authentication

I have tried using version 8.2.1.8676 of the PRT, as well as 9.0.0.9455 (I am aware this version is not made for on prem orgs). I am able to use the 8.2.1.8676 version to connect to a CRM 2015 org without issue. I have checked the Event Viewer on all of the servers, but there does not seem to be any event that is logged when this happens.

I appreciate any assistance you can offer me.

Connection settings for the PRT:

Deployment Type: On-Premises

Server: orgname.domain.com

Port: 443

Use SSL: True

Authentication Source: IFD

Username: AD domain\ admin username (I have tried this with and without the 'domain\'. In the past, I included it and it worked)

Domain: AD domain

Errors I have received:

1. With 'Use SSL' checked:

======================================================================================================================
Source : mscorlib
Method : HandleReturnMessage
Date : 7/8/2019
Time : 9:18:17 AM
Error : The server was unable to process the request due to an internal error.  For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.
Stack Trace : Server stack trace:
   at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
   at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
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 Microsoft.Xrm.Sdk.Discovery.IDiscoveryService.Execute(DiscoveryRequest request)
   at Microsoft.Xrm.Sdk.Client.DiscoveryServiceProxy.Execute(DiscoveryRequest request)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.ValidateServerConnection(CrmOrgByServer selectedOrg)
======================================================================================================================
2. Without Use SSL checked:
======================================================================================================================
Source : System.ServiceModel
Method : Retrieve
Date : 7/8/2019
Time : 9:20:55 AM
Error : Metadata contains a reference that cannot be resolved: 'http://orgname.domain.com:443/XRMServices/2011/Discovery.svc?wsdl&sdkversion=8.2'.
Stack Trace : at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
   at System.ServiceModel.Description.MetadataExchangeClient.ResolveNext(ResolveCallState resolveCallState)
   at System.ServiceModel.Description.MetadataExchangeClient.GetMetadata(MetadataRetriever retriever)
   at Microsoft.Xrm.Sdk.Client.ServiceMetadataUtility.RetrieveServiceEndpointMetadata(Type contractType, Uri serviceUri, Boolean checkForSecondary)
   at Microsoft.Xrm.Sdk.Client.ServiceConfiguration`1..ctor(Uri serviceUri, Boolean checkForSecondary)
   at Microsoft.Xrm.Sdk.Client.ServiceConfigurationFactory.CreateManagement[TService](Uri serviceUri, Boolean enableProxyTypes, Assembly assembly)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.CreateAndAuthenticateProxy[T](IServiceManagement`1 servicecfg, Uri ServiceUri, Uri homeRealm, ClientCredentials userCredentials, ClientCredentials deviceCredentials, String LogString)
   at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DiscoverOrganizations(Uri discoveryServiceUri, Uri homeRealmUri, ClientCredentials clientCredentials, ClientCredentials deviceCredentials)
   at Microsoft.Xrm.Tooling.CrmConnectControl.CrmConnectionManager.ValidateServerConnection(CrmOrgByServer selectedOrg)
======================================================================================================================
Inner Exception Level 1 :
Source : System
Method : GetResponse
Date : 7/8/2019
Time : 9:20:55 AM
Error : The request was aborted: The operation has timed out.
Stack Trace : at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Description.MetadataExchangeClient.MetadataLocationRetriever.DownloadMetadata(TimeoutHelper timeoutHelper)
   at System.ServiceModel.Description.MetadataExchangeClient.MetadataRetriever.Retrieve(TimeoutHelper timeoutHelper)
======================================================================================================================
I have tried to go to http://orgname.domain.com:443/XRMServices/2011/Discovery.svc?wsdl&sdkversion=8.2 and nothing happens. If i go to orgname.domain.com:443/.../Discovery.svc, I see the XML page.

Steps I have taken so far:

1. Restart both Async Services

2. iisreset

3. Attempted to connect from another computer (same exact result)

4. Attempted to connect using the PRT on the Front End server. (same result)

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    The weird thing about it is, I attempted to connect from my coworker's machine, as he was not in the office, and when I logged in it created a new profile on the computer. Then I downloaded the SDK and it gave me the same issue. I also RDP'ed into the frontend server and received the same issue. Seems like it is just a weird CRM bug. Oh well, it is working now and for that, I thank you again.

    I marked your first answer regarding the CRM trace as the verified answer. is there anything else I need to do?

  • Suggested answer
    N Solanki Profile Picture
    N Solanki 55 on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    Hi JoshReynolds,

    I am glad it helped. Please check if your connection is not cached in PRT (Delete and recreate Org connection).

    Organisation connection strings are stored in registry so seems like those entries are still there and somehow it is getting picked up. Sometime restarting server does help too (Application Server) but most of the time that is not an option. Another alternative is to try and clear temp folder files from .Net Framework folder (be careful as you need to pick correct sub-folder based on version as well as if you have x64 or x86 installation (Example of typical path:C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files). Also first requests to Dynamics 365 will be allot slower as it tries to build DLL cache.)

    Do you have load balancer? If you do then understand it's caching policy.

    I hope these are the options helps.

    NOTE: please disable CRMTrace once you have completed troubleshooting else you will have risk of filling up drive space.

    * Please mark it as an answered if this has resolved all your issues in this thread.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    Thank you for the suggestion to turn on Tracing. I enabled it, attempted to connect, and it created a Trace log. I got it to work after looking at the issues in the Trace log.

    Could you possibly shed some light on the issue?

    We had 3 organizations that were disabled and were version 8.2.4.6.

    The Trace log had multiple entries of "System.Data.SqlClient.SqlException (0x80131904): Cannot open database "unrelatedDisabledOrg_MSCRM" requested by the login. The login failed. Login failed for the user 'Domain\OurServiceAccount'."

    Two out of the 3 databases for these Orgs were turned off a few weeks ago when the Orgs were disabled in the Deployment Manager. When I went to check their status just now, 1 database was gone (deleted), 1 database was still on, and the offending database from the log was in (Recovery Pending) state.

    Why would a database that is unrelated, save for being on the same SQL server, prevent the PRT from connecting to working CRM Orgs?

    Thank you very much for the guidance!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    I am about to go through enabling Tracing and will post the results. In the meantime, my CRM organizations are Version 1612 (8.2.5.4) (DB 8.2.5.4) on-premises.

    I downloaded the PRT using the SDK. I do not see an unblock checkbox on the SDK self-extracting .exe. Some of the DLL files that came with it are as follows:

    1. Microsoft.Xrm.Sdk.dll:  8.2.0.711

    2. Microsoft.Crm.Sdk.Proxy.dll:  8.2.0.729

    3. Microsoft.Xrm.Sdk.Workflow.dll: 8.0.1.57

    4. Microsoft.Xrm.Tooling.Connector.dll:  2.2.2.804

    5. Microsoft.Xrm.Tooling.CrmConnectControl.dll:  2.2.2.804

    I have also tried using the Dynamics 365 version of the PRT, even though it states it is for versions 9.X. I downloaded this via the SDK as well. The PRT version is 9.0.0.9455. The DLL files that came with it are as follows:

    1. Microsoft.Xrm.Sdk.dll:  9.0.37.958

    2. Microsoft.Crm.Sdk.Proxy.dll:  9.0.37.958

    3. Microsoft.Xrm.Sdk.Workflow.dll: 9.0.37.958

    4. Microsoft.Xrm.Tooling.Connector.dll:  3.0.0.969

    5. Microsoft.Xrm.Tooling.CrmConnectControl.dll:  3.0.0.969

    I will post the Tracing results once I get it turned on and attempt to connect. Thank you for your help

  • Verified answer
    N Solanki Profile Picture
    N Solanki 55 on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    Hi,

    Please enable CRM Trace and try connecting it again. For more information please visit following URL.

    support.microsoft.com/.../how-to-enable-tracing-in-microsoft-dynamics-crm

    Also confirm how did you download PluginRegistrationTool? Is it from SDK or Nuget? Check if DLLs along with PluginRegistrationTool matches with your organisation version. v8.2.5.4 suggest, you have upgraded to Dynamics 365.

    If you are downloading SDK to access PRT then after download, right click downloaded file, go to property, tick unblock, click apply and then extract it.

    I hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    I appreciate the reply Narayan.

    I am able to access all of the sites through an internet browser. The Discovery Web Service Domain and IFD Domain in the Deployment Manager are correct as far as I can tell. The System Checks complete without error. They have not changed since the first organization was set up, which I was able to access using the PRT.

    The user is the System Administrator for all of the organizations.

    Could you point me in the direction to provide more trace log information? I am unsure what would be helpful with troubleshooting this issue.

    -Josh

  • N Solanki Profile Picture
    N Solanki 55 on at
    RE: Unable to connect to on premise CRM 2016 instances using the PluginRegistrationTool

    Hi,

    Error message indicates that you have only HTTPS enabled therefore you must use https URL. (with "Use SSL" checked)

    Can you please check your deployment manager and confirm you have correct URLs configured. Also when you tried to browse discovery service, you can see XML which shows you are successfully connected over SSL (https URL). This seems like you are getting error while sending request to retrieve response.

    Can you please check if your user has all required permissions in these new organisations?

    I hope this solves your issue. If not, please share more trace log information if you can.

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans