« Compiling while you wait for the CRM 4.0 SDK | Main | CRM 4.0 Ships!! »

Active Directory and DNS Gotcha

I was doing an install of the RTM 4.0 into an existing domain end of this week and things were going well until all of a sudden in the last screen of the install the magic words "Failed appeared".  Turns out I received an exception during the query of Active Directory for the setup user.

I quickly turned to dcdiag, repadmin, netdiag, ldp and a few other of my favorite active directory tools (did I say favorite and Active Directory in the same line?).   If your not familiar with these tools they are part of the Windows 2003 support package that you can download.  If you ever call into MS about an AD issue expect them to be among some of the first things they look at.

Everything looked pretty good except the install wouldn't complete - no matter how much I wanted it to finish ok, I would still get "A referral was returned from the server"

Turns out that during the install CRM will do a query to active directory for the setup user.  Active directory if it thinks there might be a subdomain that can answer part of the query AND you specify to chase referral chains on your directory search query request (which CRM appears to do) it will throw an exception telling you that there is more information to process from referral servers and CRM would need to handle that (which it doesn't appear to do very well).  In reality, I believe it was getting the answer back but AD was suggesting that other "servers" could give more details and advising the caller that by throwing the exception.  Only problem was CRM doesn't handle that exception - it just kills the install. So what you end up with is "A referral was returned from the server" message at the end of a 10-15 minute retry attempt.

In all honesty, I'm not 100% sure what the culprit was - other than a re-install of DNS on the DC finally fixed it but not with out pulling some hair out first!  This is where in AD, DNS and AD are tied at the hip to perform processing.

Here's the stack trace in case it helps someone else out... I wouldn't wish this error on anyone!

 

|  Error| Install exception.System.Exception: Action Microsoft.Crm.Setup.Server.ProvisionBusinessAction failed. ---> System.Runtime.InteropServices.COMException (0x8007202B): A referral was returned from the server.

   at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext()

   at System.DirectoryServices.SearchResultCollection.get_InnerList()

   at System.DirectoryServices.SearchResultCollection.get_Count()

   at Microsoft.Crm.BusinessEntities.SecurityUtils.GetGuidFromSid(DirectorySearcher searcher, Byte[] sid)

   at Microsoft.Crm.BusinessEntities.SecurityUtils.TryGetGuidFromSid(Byte[] sid)

   at Microsoft.Crm.BusinessEntities.SecurityUtils.GetUserId(String domainName)

   at Microsoft.Crm.BusinessEntities.SecurityLibrary.GetUserId(String NTName)

   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.CreateInternal(Guid organizationId, IBusinessEntity systemuser, ExecutionContext context)

   at Microsoft.Crm.ObjectModel.SystemUserServiceInternal`1.ProvisionCreate(IBusinessEntity systemuser, ExecutionContext context)

   at Microsoft.Crm.ObjectModel.OrganizationServiceInternal`1.CreateRootBusiness(IBusinessEntity organization, IBusinessEntity business, IBusinessEntity systemUser, ExecutionContext context)

   at Microsoft.Crm.Setup.Server.Utility.NewOrgUtility.OrganizationCreateNew(String organizationId, String organizationName, String userAccountName, String userFirstName, String userLastName, String userEmail, String featureSetFile, String languageCode, String privilegedUserGroup, String sqlAccessGroup, String userGroup, String reportingGroup, String privilegedReportingGroup, Boolean grantNetworkServiceAccess)

   at Microsoft.Crm.Setup.Server.ProvisionBusinessAction.Do(IDictionary parameters)

   at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)

Posted on Sunday, December 23, 2007 at 10:42PM by Registered CommenterDavid Yack | Comments3 Comments | References1 Reference

EmailEmail Article to Friend

References (1)

References allow you to track sources for this article, as well as articles that were written in response to this article.
  • Response
    Response: ????? ????
    Magic Jewball wrote an interesting post today on Listening to: Madonna-

Reader Comments (3)

MrDave-
I am having the same exact problem right now with the CRM 4.0 Install. Your post has been helpful, but I wanted to ask you if you could follow up more with what you did with DNS to resolve the issue? I am working in conjunction with MBS support to figure this out and so far neither of us has been able to troubleshoot the error effectively. Any help would be great. Thanks!
-Kevin-
January 23, 2008 | Unregistered CommenterKevin
Kevin - I spent a lot of time with the standard AD tools such as dcdiag and netdiag I would also check your AD replication between your DCs - feel free to drop me an e-mail via the contact link and send me more details on where you are stuck...
January 23, 2008 | Registered CommenterDavid Yack
I am also recieving a similar error near the end of a CRM 4.0 Upgrade of 3.0 on a virtual test system.

Using VS 2005 R2 SP1

All green checks at Environment Check

Using Administrator Account (Domain Admins Group)

Administrator has sysadmin permissions in SQL2005sp2

error reads asfollows:

16:02:50| Error| System.Exception: Action Microsoft.Crm.Setup.Server.InstallDatabaseAction failed. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8007202B): A referral was returned from the server.

at System.DirectoryServices.SearchResultCollection.ResultsEnumerator.MoveNext()
at System.DirectoryServices.SearchResultCollection.get_InnerList()
at System.DirectoryServices.SearchResultCollection.get_Count()
at Microsoft.Crm.BusinessEntities.SecurityUtils.GetGuidFromAccountName(DirectorySearcher searcher, String name)
at Microsoft.Crm.BusinessEntities.SecurityUtils.GetGuidFromServerName(String serverName)
at Microsoft.Crm.BusinessEntities.SecurityUtils.GetLocalSystemGuid()
at Microsoft.Crm.Caching.OrganizationSettingsCacheLoader.LoadCacheData(Guid key, ExecutionContext context)
at Microsoft.Crm.Caching.ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context)
at Microsoft.Crm.Caching.BasicCrmCache`2.CreateEntry(TKey key, IOrganizationContext context)
at Microsoft.Crm.Caching.BasicCrmCache`2.LookupEntry(TKey key, IOrganizationContext context)
at Microsoft.Crm.Metadata.LocalizationHelper.GetLabelsForResource(String resourceName, Guid objectId, String objectColumnName, String collectionName, String labelName, IOrganizationContext context)
at Microsoft.Crm.Metadata.MigrationAttributeHelper.CreateImportSequenceNumberField(Guid entityId, MetadataHelper metadataHelper, ExecutionContext context)
at Microsoft.Crm.DataUpgrade.MigrationFieldsUpgrade.MigrationFieldsUpgradeDriver.UpgradeCustomEntitiesForMigration()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
at Microsoft.Crm.Setup.Database.DllMethodAction.Execute()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.ExecuteReleases(ReleaseCollection releases, Int32 currentProgress)
at Microsoft.Crm.Setup.Database.DatabaseInstaller.installInternal()
at Microsoft.Crm.Setup.Database.DatabaseInstaller.Install(Int32 languageCode, String configurationFilePath, Boolean upgradeDatabase)
at Microsoft.Crm.Setup.Server.InstallDatabaseAction.Do(IDictionary parameters)
at Microsoft.Crm.Setup.Common.Action.ExecuteAction(Action action, IDictionary parameters, Boolean undo)
--- End of inner exception stack trace ---, Error, RetryCancel, Option1


Any assistance would be appreciated.

TY
April 23, 2008 | Unregistered CommenterDave Murdock

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
All HTML will be escaped. Hyperlinks will be created for URLs automatically.