Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Updating Dynamics 365 on-prem 9.1.16.20 to any newer cumulative update failing

(0) ShareShare
ReportReport
Posted on by 147
 ​It has been a while since I've updated our Dynamics 365 9.1 on premise environment.  Currently it has the Feb 2023 CU (9.1.16.20).  I spun up a copy of our environment in a lab and tried to install and update to 9.1.24.11.  The install finished but at the end of the install it tries to update the existing organization and that is where it fails.  I thought maybe that was too big of a jump so I tried to just go to the very next CU  (9.1.17.29) and it does the same thing, the install finished but its unable to upgrade the organization database.

The final error in the log regarding the database upgrade piece is this:

Error| Database Updates failed for org c9619898-6674-4669-97a6-a970a4b10237 with exception: Microsoft.Crm.CrmException: Update Organization with Id=c9619898-6674-4669-97a6-a970a4b10237 failed with Exception:
Microsoft.Crm.CrmException: Encountered non-terminal failures during DBUpdates. Failing actions are: CustomControlsCore, BaseCustomControlsCore, SolutionHistoryAPIs, CRMSettingsAPIs, DataModelingExtensions, ApiMessagesExtension, LocalizationExtensionApps, DataServicesExtensions, AppModuleExtensions, ODatav4DataProvider, WebResourcePages, msdyn_PowerConnectors, EnvironmentVariables, MicrosoftFlowExtensionsAnchor, PowerPlatformConnectionReferencesAnchor, msdyn_ContextualHelpAnchor, msdynce_CustomerCareIntelligenceBots_Anchor, msdynce_ClientUtility, msdynce_AppCommonAnchor, msdynce_Activities, msdynce_ServiceLevelAgreementAnchor, msdynce_KnowledgeManagementAnchor, ActivitiesInfra, ServerSideSync, CDSApiExtensions, CustomAPIExtensions, AsyncServiceExtensionsApp, SampleEditorCustomControl, msdyn_CustomControlsExtended, CRMDesigners, msdyn_AISolutionAnchor, msdynce_LeadManagementAnchor, msdynce_ProductManagementAnchor, Scheduling_Anchor, msdynce_MarketingAnchor, msdynce_ServiceAnchor, msdynce_SalesAnchor, msdynce_MarketingServiceAnchor, msdynce_MarketingSalesAnchor, msdynce_SalesServiceAnchor, msdynce_CRMExtensionsAnchor, msdyn_SalesIntegrationsAddOns, msdynce_SalesInsightsAnchor, ActivityFeedsCore, AppforOutlook, SkypeForBusiness, msdynce_OfficeProductivityAnchor

 
 

Further up in the log file each one of those solution/packages that are referenced in the error above I see the follow exception:

Info| Failed to install msdynce_OfficeProductivityAnchorException: Microsoft.Crm.CrmException: Crm Internal Exception: Singleton Retrieve Query should not return more than 1 record.
   at Microsoft.Crm.ServerLocatorService.TryGetCrmUserIdFromDatabase(Guid organizationId, String authenticationInfo, Guid& crmUserId)

 

They all reference that 'Singleton Retrieve Query should not return more than1 record'.   I don't know a way to get more info about what query it is running to see where there appears to be some duplicate records that shouldn't be.   Anyone have any suggestions on how to get this updated to the latest CU?  Thanks in advance for any and all help!

 

-Chris
  • Suggested answer
    cmillerlce Profile Picture
    cmillerlce 147 on at
    Updating Dynamics 365 on-prem 9.1.16.20 to any newer cumulative update failing
    In the off chance someone runs into this same issue or similiar, the root cause ended up being that there were duplicate Userid records in the [MSCRM_CONFIG].[dbo].[SystemUserOrganizations] table.  The admin account that we've been using for years and years for some reason had (2) records in that table.  I simply changed the Login name of that admin account in CRM to a different AD user temporarily and saved the record.  Then went into SQL and deleted the (2) duplicate rows in [MSCRM_CONFIG].[dbo].[SystemUserOrganizations] for that offending userID.  I then went back into CRM, and changed the admin account back to the correct AD user account name and it was able to save without error.  Once that account was fixed, I was then able to run the upgrade without error.
     
    On a whim I had thought to try the upgrade as a differnet user which required me to grant a bunch of access to SQL and CRM for the account but the upgrade was successful so I knew to focus on the original admin account.

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans