Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Upgrading to Microsoft Dynamics Server Version 9.0 on-premises results in error: Error.ActionFailed Microsoft.Crm.Tools.Admin.OneTimePostAppsInstallUpgradeAction


View products that this article applies to.

Symptom

When upgrading from Microsoft Dynamics 365 8.x to Microsoft Dynamics Server Version 9.0 for on-premises, the following error is occurring.

Exception occurred during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.OneTimePostAppsInstallUpgradeAction

Furthermore, reviewing the upgrade log file crmdmsnapin.log, we see the following full context of the error message.

Error| Installer Complete: OrganizationUpgrader - Error encountered
Error| Exception occurred during Microsoft.Crm.Tools.Admin.OrganizationUpgrader: Error.ActionFailed Microsoft.Crm.Tools.Admin.OneTimePostAppsInstallUpgradeAction
InnerException:
Microsoft.Crm.Metadata.EntityMetadataNotFoundException: The entity with ObjectTypeCode = 0 was not found in the MetadataCache. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=748967650, MinActiveRowVersion=748967650
   at Microsoft.Crm.Metadata.DynamicMetadataCache.GetEntity(Int32 entityCode)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.LegacyListExecutionParams.ToUpgradedParameters(EntitySerializer serializer, BusinessEntityToEntityConverter businessEntityTypeConverter, ICrmConversionContext conversionContext, ExecutionContext context)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.ProcessListBasedBulkOperation(BusinessEntity entity, ICrmConversionContext conversionContext, ExecutionContext context)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.ProcessEntity(BusinessEntity entity, ICrmConversionContext conversionContext, ExecutionContext context)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.ProcessEntities(BusinessEntityCollection entities, ICrmConversionContext conversionContext, ExecutionContext context)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.RunUpgrade(ExecutionContext context)
   at Microsoft.Crm.SE.DatabaseActions.DllMethodActions.UpdateBulkOperationParametersAction.Execute()
   at Microsoft.Crm.Tools.Admin.OneTimePostAppsInstallUpgradeAction.Do(IDictionary parameters)
   at Microsoft.Crm.Setup.Shared.CrmAction.ExecuteActionHelper(CrmAction action, IDictionary parameters, Boolean undo)

↑ Back to the top


Cause

One possible cause of this error is that there may be bulk operations jobs that have not completed or are in a pending state.

↑ Back to the top


Resolution

To verify if this issue is caused by unfinished/pending bulk operation jobs, run the following SQL query against your OrgName_MSCRM database.

SELECT StateCode, ActivityId, CreatedOn FROM BulkOperation WHERE StateCode NOT IN (1,2)

If the above query does return any results, these bulk operation jobs will need to be allowed to finish or they will need to be updated to a state of 1. For example, the results of the query would display something similar to below.

StateCode ActivityId CreatedOn
0 72BB4074-A3EA-D311-82E6-2213V23D9E50 2009-12-16 23:19:27.000

 

To correct the issue for these particular results, a SQL update will need to be run. The update statement is listed below.

UPDATE [BulkOperation]
SET [StateCode] = 1
WHERE [ActivityId] = '72BB4074-A3EA-D311-82E6-2213V23D9E50'

Once the above update has run, start the upgrade to Version 9 again and it should complete successfully.

↑ Back to the top


Keywords: dynamics 365, UpdateBulkOperationParametersAction, The entity with ObjectTypeCode = 0 was not found in the MetadataCache, OneTimePostAppsInstallUpgradeAction, Exception occurred during Microsoft.Crm.Tools.Admin.OrganizationUpgrader

↑ Back to the top

Article Info
Article ID : 4487223
Revision : 7
Created on : 1/9/2019
Published on : 1/9/2019
Exists online : False
Views : 251