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)