Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Answered

Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

Posted on by 80

After applying the 9.1 Patch to a multi instance Dynamics-Server, I was able to upgrade every instance but one. 

The error displayed by the installer and the last lines of our crmdmsnapin.log was:

12:03:23|  Error| Update Organization with Id=db3b7287-dff8-e611-80cb-00155dfa825e failed with Exception:
Microsoft.Crm.CrmException: Encountered non-terminal failures during DBUpdates. Failing actions are: msdynce_SalesAnchor
   at Microsoft.Crm.Tools.Admin.OrganizationDBUpdateInstaller.ProcessFailedActions()
   at Microsoft.Crm.Tools.Admin.OrganizationDBUpdateInstaller.<>c__DisplayClass19_0.<Execute>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.Tools.Admin.OrganizationDBUpdateInstaller.Execute()
   at Microsoft.Crm.Tools.Admin.DBUpdateInstaller.ApplyDatabaseUpdates(IDBUpdateInfo dbUpdateInfo)

Digging deeper in the crmdmsnapin.log, I found a more detailed error message:

12:22:15| Info| Found msdynce_SalesAnchor in cache C:\Program Files\Dynamics 365\Setup\Serviceability\Latest\Actions_Org\Install\PkgCache\V_9_1_0001_0914\msdynce_SalesAnchor\V227512675.
12:22:15| Info| Found msdynce_SalesAnchor packageFile C:\Program Files\Dynamics 365\Setup\Serviceability\Latest\Actions_Org\Install\Packages\CRMApps\msdynce_Sales_managed_Package.zip in cache C:\Program Files\Dynamics 365\Setup\Serviceability\Latest\Actions_Org\Install\PkgCache\V_9_1_0001_0914\msdynce_SalesAnchor\V227512675.
12:22:15| Info| PackageDeployer: Starting msdynce_SalesAnchor install.
12:22:15| Info| PackageDeployer: Starting msdynce_SalesAnchor install with RuntimeSettings: GeoName=ONP|OperationType=DatabaseHotFix|OrgSchemaType=CRM|OriginalDBVersion=9.0.18.12|CurrentDBVersion=9.1.1.914|IsUpgrade=False|ExternalStorageFcb=False|FileTypeFcb=True
12:22:37| Info| Failed to install package msdynce_SalesAnchor on attempt 1.
12:22:38| Info| Failed to install msdynce_SalesAnchorException: Microsoft.Crm.PackageDeployment.PackageDeployerException: Package msdynce_SalesAnchor failed to install on attempt 0.
System.AggregateException: One or more errors occurred. ---> System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Invalid operation context for transition. Expected: MoveSystemComponentToFirstPartySolution OR Upgrade, Received: Patch Component Type: 1 Object Id: e38acf85-1355-e811-a94b-00155d0fe922 CurrentState: Active
at Microsoft.Crm.MultiTenantPackageDeployment.PdExecutor.Process(PackageDeploymentInputArgs input, JobOutput`1 output, CancellationToken ct)
at System.Threading.Tasks.Task.Execute()
--- End of inner exception stack trace ---
---> (Inner Exception #0) System.ServiceModel.FaultException`1[Microsoft.Xrm.Sdk.OrganizationServiceFault]: Invalid operation context for transition. Expected: MoveSystemComponentToFirstPartySolution OR Upgrade, Received: Patch Component Type: 1 Object Id: e38acf85-1355-e811-a94b-00155d0fe922 CurrentState: Active (Fault Detail is equal to Exception details:
ErrorCode: 0x80040203
Message: Invalid operation context for transition. Expected: MoveSystemComponentToFirstPartySolution OR Upgrade, Received: Patch Component Type: 1 Object Id: e38acf85-1355-e811-a94b-00155d0fe922 CurrentState: Active
TimeStamp: 2021-07-16T10:22:37.8211640Z
--
Exception details:
ErrorCode: 0x80040203
Message: Invalid operation context for transition. Expected: MoveSystemComponentToFirstPartySolution OR Upgrade, Received: Patch Component Type: 1 Object Id: e38acf85-1355-e811-a94b-00155d0fe922 CurrentState: Active
TimeStamp: 2021-07-16T10:22:37.8211640Z
--
).<---
[...]
[16.07.2021 10:22:37]: MTPD: PackageDeployer reported status [Failed] during import: Failed to load solution Sales Patch Version 2, version: 9.0.1912.1007. See the log file.

Do you have any clue what this could mean? I found literally nothing to the error "Invalid operation context for transition. Expected: MoveSystemComponentToFirstPartySolution OR Upgrade, Received: Patch"...

Thanks in advance and kind regards,

Carsten

  • Carsten Brenner Profile Picture
    Carsten Brenner 80 on at
    RE: Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

    Hi Pedro,

    that sounds reasonable, i will mark this reply as answer, too.

    Maybe it will help someone in the future :)

    Best regards,

    Carsten

  • Suggested answer
    RE: Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

    Hello Carsten,

    Hope you are well.

    Thank you for the reply.

    Adding to your reply, we are seeing the issue on intersect entities.

    It seems that we need to run your above script not only on the intersect entity logical name that shows on the logs, but also the outer entities.

    Making an example:

    - The error logs show an entityID

    - Then we fetch whats that entityID from Entity table.

    - We see its an intersect entity because it has the format:   new_entity1_entity2

    - Then we need to execute the script for all the 3 entities:

    BEGIN TRY

    BEGIN TRAN T1

    UPDATE [MetadataSchema].[Entity] SET IsOfflineInMobileClient = 1, IsVisibleInMobileClient = 1

    WHERE LogicalName = 'new_entity1_entity2' or LogicalName = 'entity1' or LogicalName = 'entity2'

    COMMIT TRAN T1

    END TRY

    BEGIN CATCH

    ROLLBACK TRANSACTION T1

    PRINT 'EXECUTION FAILED : ' + Error_Message()

    END CATCH

  • Carsten Brenner Profile Picture
    Carsten Brenner 80 on at
    RE: Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

    Hi Pedro,

    you were completely right. The way you showed us is the more understandable way via the frontend, whilst our ticket processor showed us how to fix it via SQL Queries.

    For others that may walk into this - The Query needed for finding the right entity was:

    Select * from entity where entityid =' e38acf85-1355-e811-a94b-00155d0fe922'

    The follow-up query to set the booleans as already described by you was:

    BEGIN TRY
    BEGIN TRAN T1
    UPDATE [MetadataSchema].[Entity] SET IsOfflineInMobileClient = 1, IsVisibleInMobileClient = 1
    WHERE LogicalName = '[Logical Name from 1st Query without Brackets]'
    COMMIT TRAN T1
    END TRY
    BEGIN CATCH
    ROLLBACK TRANSACTION T1
    PRINT 'EXECUTION FAILED : ' + Error_Message()
    END CATCH

    After that, the Update was successful. Afaik there can be more Entities with that problem, so you may have to redo this for other entity ids.

    Thanks again and have a nice day!

    Best regards, 

    Carsten

  • Carsten Brenner Profile Picture
    Carsten Brenner 80 on at
    RE: Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

    Hi Pedro,

    thank you very much for your reply! I actually opened a ticket at microsoft later that day. I'll follow the steps i get advised there, but it seems like he is pointing to the same thing as you.

    I'll come back here when we made it to work and will then accept your anwer, if you were right, too. So stay tuned, but there is no further action required from your side right now.

    Yet, I really appreciate your help and thank you so much for your time and effort!

    Best regards,

    Carsten

  • Suggested answer
    RE: Error on Upgrading one Instance after installing 9.1 (SP1) - Problem with "msdynce_SalesAnchor"

    Hello Carsten,

    Hope you are well.

    This needs an engagement with support on a ticket as this can be complex.

    The first step here is to understand what entity that object id belongs to: "e38acf85-1355-e811-a94b-00155d0fe922".

    This can be achieved by running some type of "search all" script on SQL on using any 3rd party extension on sql that does this job.

    Component type 1 = entity

    Then depending on that, the mitigation might differ.

    If it is an intersect entity, it might be related to a mobile offline problem, which needs to be resolved either via a SQL script or the UI before attempting the upgrade:

    1. Open the customization dialog for the intersect entity

    2. Set the "Enable for Mobile offline" flag and Unified Client flag (if needed).

    pastedimage1626691378258v1.png

    3. Save the changes at the top. (You may also need to set a Display Name and/or Plural Name for the entity which you can just fill with the entity name)

    4. Publish the entity at the top.

    Please try these steps and see if it unblocks the upgrade. If there are other custom intersect entities which cause a similar failure, take the intersect entity id and insert it into the "id={}" portion of the customization dialog URL above and follow the same steps.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans