最近、開発環境からアンマネージド ソリューションとして CRM (UR13) に更新プログラムを展開しました。なんらかの不明な理由で、これによりアカウント エンティティの 3 つの OptionSet フィールドからカスタマイズが削除され、5 日後に気付いたときにデータ破損地獄が発生しました =/.
いずれにせよ、私は当分の間異常に落ち着くつもりです。私は背景のためにそれを持ち出すだけです。この問題を解決するには、アンマネージド ソリューション (アカウント エンティティを含む) を再インポートして、これらの OptionSet を再構築する必要があります。2 つのテスト環境を作成しました。1 つはアンマネージド ソリューションがデプロイされる前のライブ バックアップからのもので、もう 1 つは現在の状態を表すものです。
同じソリューション パッケージをいずれかのテスト環境にインポートすると、The entity with a name = 'RecordCountSnapshot' was not found in the MetadataCache.
エラーがスローされるようになりました。そもそもどうやってソリューションをライブ環境にインポートしたのですか? それだけではありません。これらの環境にデプロイされたほとんどのソリューションで同じエラーが発生し、修復や将来のカスタマイズが不可能に見えるようです。
非RecordCountSnapshot
表示のエンティティは、すべての SQL データベースにテーブルとして存在し、実行するメタデータ クエリに存在します。このフォーラムへの投稿は、私がこの問題で見つけた唯一の有用な参照ですが、残念ながら未解決です。
この問題の解決に役立つ可能性のある最小の洞察を誰かが提供できる場合、私は非常に感謝しています XD.
編集:
@Daryl が要求した W3WP トレース ファイル - さらに情報が必要な場合は、お知らせください。
参考までに、このトレースに記載されているクエリを手動で実行したところ、問題なく 346 件の結果が返されました
>Query execution time: 0.0 seconds; database: Organisation_MSCRM_220713_2330; Server:PY3-CRMTEST; command: select
"recordcountsnapshot0".ObjectTypeCode as "objecttypecode"
, "recordcountsnapshot0".Count as "count"
, "recordcountsnapshot0".RecordCountSnapshotId as "recordcountsnapshotid"
from
RecordCountSnapshot as "recordcountsnapshot0" (NOLOCK) .
[2013-07-31 16:24:53.614] Process: w3wp |Organization:2c22b814-38f9-e211-8151-00155d143602 |Thread: 14 |Category: Exception |User: 9b39cd7c-231c-4c66-9459-327009bcb0ef |Level: Error |ReqId: a0ac1144-4cce-43b1-bc27-08484d9a73bc | CrmException..ctor ilOffset = 0x0
at CrmException..ctor(String message, Exception innerException, Int32 errorCode, Boolean isFlowControlException) ilOffset = 0x0
at CrmException..ctor(String message, Int32 errorCode) ilOffset = 0x0
at DynamicMetadataCache.GetEntity(String entityName, NameMappingType mapping) ilOffset = 0x13
at BusinessEntityCollection.get_EntityMetadata() ilOffset = 0x37
at BusinessProcessObject.FillEntityCollectionFromDataReader(BusinessEntityCollection entities, IDataReader reader, EntityExpression entityExp, Boolean useEntityExpression, String aggregateLimitExceededName, Boolean quickFindRecordLimitCheckRequired, ExecutionContext context) ilOffset = 0x70
at BusinessProcessObject.QueryAndFillEntityCollection(CrmDbConnection dbConnection, IDbCommand dbCommand, BusinessEntityCollection entities, EntityExpression entityExp, PagingHelper pagingHelper, Boolean useEntityExpression, String aggregateLimitExceededName, ExecutionContext context) ilOffset = 0x4D
at BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, PagingHelper pagingHelper, ExecutionContext context) ilOffset = 0x41
at BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x40
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x76
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x0
at RecordCountCacheLoader.LoadCacheData(Guid key, ExecutionContext context) ilOffset = 0x62
at ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context) ilOffset = 0x25
at CrmMultiOrgCacheBase`2.CreateEntry(TKey key, IOrganizationContext context) ilOffset = 0x0
at CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context) ilOffset = 0x26
at RecordCountCache.RetrieveRecordCount(Int32 objectTypeCode, IOrganizationContext context) ilOffset = 0x7
at SecurityExtensionRetrieveMultipleHelper.GetRetrieveMultipleSecurityFilterOption(RetrieveMultipleSecurityFilterPopulatorInitializationData initializationData, ExecutionContext context) ilOffset = 0x7A
at SecurityExtension.CreateSecurityFilter(Guid user, EntityMetadata entityMetadata, FilterExpression existingCriteria, ExecutionContext context, Boolean noLock, LinkEntityType linkEntityType, RetrieveMultipleSecuritySqlFormat& securitySqlFormat) ilOffset = 0x3E
at SecurityExtension.AddSecuritySql(Guid user, EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x28
at SecurityExtension.PreRetrieveMultipleHandler(ExtensionEventArgs e) ilOffset = 0x19
at PreRetrieveMultipleEventHandler.Invoke(Object sender, ExtensionEventArgs e) ilOffset = 0xFFFFFFFF
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x5F
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x0
at ImportSolutionConfigurationPageHandler.ImportItem() ilOffset = 0x60
at ImportHandler.Import() ilOffset = 0x43
at RootImportHandler.ImportAndUpdateProgress(ImportHandler ih) ilOffset = 0x7
at RootImportHandler.HandleNonMetadataHandlers(String[] ImportEntities, ImportHandler& ihForCurrentPath) ilOffset = 0x33
at RootImportHandler.RunImport(String[] ImportEntities) ilOffset = 0x1D8
at ImportXml.RunImport(String[] ImportEntities) ilOffset = 0xE
at ImportXml.RunImport() ilOffset = 0x5B3
at ImportXmlService.ImportSolutionSkipCapable(Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Byte[] customizationFile, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, ExecutionContext context) ilOffset = 0x46
at RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) ilOffset = 0x101
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0x0
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x156
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse) ilOffset = 0x145
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x34
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xF6
at ImportSolutionCommand.Execute() ilOffset = 0x20
at DataSource.ImportSolution(Byte[] customizationFile, Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, IOrganizationContext context) ilOffset = 0x0
at SolutionImportProcessPage.ImportSolution() ilOffset = 0x11E
at SolutionImportProcessPage.ProcessRequestData() ilOffset = 0x4A
at SolutionImportProcessPage.ProcessAction(String action) ilOffset = 0x92
at AppUIPage.OnPreRender(EventArgs e) ilOffset = 0xD
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x69E
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x31
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x11D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0x10E
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0xFC
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x45
>Crm Exception: Message: The entity with a name = 'RecordCountSnapshot' was not found in the MetadataCache., ErrorCode: -2147217150
[2013-07-31 16:24:53.614] Process: w3wp |Organization:2c22b814-38f9-e211-8151-00155d143602 |Thread: 14 |Category: Platform.Sql |User: 9b39cd7c-231c-4c66-9459-327009bcb0ef |Level: Error |ReqId: a0ac1144-4cce-43b1-bc27-08484d9a73bc | BusinessProcessObject.DoRetrieveMultiple ilOffset = 0x41
at BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, PagingHelper pagingHelper, ExecutionContext context) ilOffset = 0x41
at BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x40
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x76
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x0
at RecordCountCacheLoader.LoadCacheData(Guid key, ExecutionContext context) ilOffset = 0x62
at ObjectModelCacheLoader`2.LoadCacheData(TKey key, IOrganizationContext context) ilOffset = 0x25
at CrmMultiOrgCacheBase`2.CreateEntry(TKey key, IOrganizationContext context) ilOffset = 0x0
at CrmMultiOrgCacheBase`2.LookupEntry(TKey key, IOrganizationContext context) ilOffset = 0x26
at RecordCountCache.RetrieveRecordCount(Int32 objectTypeCode, IOrganizationContext context) ilOffset = 0x7
at SecurityExtensionRetrieveMultipleHelper.GetRetrieveMultipleSecurityFilterOption(RetrieveMultipleSecurityFilterPopulatorInitializationData initializationData, ExecutionContext context) ilOffset = 0x7A
at SecurityExtension.CreateSecurityFilter(Guid user, EntityMetadata entityMetadata, FilterExpression existingCriteria, ExecutionContext context, Boolean noLock, LinkEntityType linkEntityType, RetrieveMultipleSecuritySqlFormat& securitySqlFormat) ilOffset = 0x3E
at SecurityExtension.AddSecuritySql(Guid user, EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x28
at SecurityExtension.PreRetrieveMultipleHandler(ExtensionEventArgs e) ilOffset = 0x19
at PreRetrieveMultipleEventHandler.Invoke(Object sender, ExtensionEventArgs e) ilOffset = 0xFFFFFFFF
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, DatabaseQueryTarget queryTarget, ExecutionContext context) ilOffset = 0x5F
at BusinessProcessObject.RetrieveMultiple(EntityExpression entityExpression, ExecutionContext context) ilOffset = 0x0
at ImportSolutionConfigurationPageHandler.ImportItem() ilOffset = 0x60
at ImportHandler.Import() ilOffset = 0x43
at RootImportHandler.ImportAndUpdateProgress(ImportHandler ih) ilOffset = 0x7
at RootImportHandler.HandleNonMetadataHandlers(String[] ImportEntities, ImportHandler& ihForCurrentPath) ilOffset = 0x33
at RootImportHandler.RunImport(String[] ImportEntities) ilOffset = 0x1D8
at ImportXml.RunImport(String[] ImportEntities) ilOffset = 0xE
at ImportXml.RunImport() ilOffset = 0x5B3
at ImportXmlService.ImportSolutionSkipCapable(Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Byte[] customizationFile, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, ExecutionContext context) ilOffset = 0x46
at RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) ilOffset = 0xFFFFFFFF
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) ilOffset = 0x101
at RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) ilOffset = 0x0
at LogicalMethodInfo.Invoke(Object target, Object[] values) ilOffset = 0x4F
at InternalOperationPlugin.Execute(IServiceProvider serviceProvider) ilOffset = 0x57
at V5PluginProxyStep.ExecuteInternal(PipelineExecutionContext context) ilOffset = 0x50
at VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context) ilOffset = 0x65
at Pipeline.Execute(PipelineExecutionContext context) ilOffset = 0x65
at MessageProcessor.Execute(PipelineExecutionContext context) ilOffset = 0x1C5
at InternalMessageDispatcher.Execute(PipelineExecutionContext context) ilOffset = 0xE4
at ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion) ilOffset = 0x156
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse) ilOffset = 0x145
at OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x34
at OrganizationSdkServiceInternal.Execute(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType) ilOffset = 0x24
at InprocessServiceProxy.ExecuteCore(OrganizationRequest request) ilOffset = 0x34
at PlatformCommand.XrmExecuteInternal() ilOffset = 0xF6
at ImportSolutionCommand.Execute() ilOffset = 0x20
at DataSource.ImportSolution(Byte[] customizationFile, Boolean overwriteUnmanagedCustomizations, Boolean publishWorkflows, Guid importJobId, Boolean convertToManaged, Boolean skipProductUpdateDependencies, IOrganizationContext context) ilOffset = 0x0
at SolutionImportProcessPage.ImportSolution() ilOffset = 0x11E
at SolutionImportProcessPage.ProcessRequestData() ilOffset = 0x4A
at SolutionImportProcessPage.ProcessAction(String action) ilOffset = 0x92
at AppUIPage.OnPreRender(EventArgs e) ilOffset = 0xD
at Control.PreRenderRecursiveInternal() ilOffset = 0x54
at Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x69E
at Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) ilOffset = 0x3C
at Page.ProcessRequest() ilOffset = 0x14
at Page.ProcessRequest(HttpContext context) ilOffset = 0x31
at CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() ilOffset = 0x11D
at HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) ilOffset = 0x15
at ApplicationStepManager.ResumeSteps(Exception error) ilOffset = 0x10E
at HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) ilOffset = 0x5C
at HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) ilOffset = 0xFC
at ISAPIRuntime.ProcessRequest(IntPtr ecb, Int32 iWRType) ilOffset = 0x45
>Exception when executing query: select
"recordcountsnapshot0".ObjectTypeCode as "objecttypecode"
, "recordcountsnapshot0".Count as "count"
, "recordcountsnapshot0".RecordCountSnapshotId as "recordcountsnapshotid"
from
RecordCountSnapshot as "recordcountsnapshot0" (NOLOCK) Exception: Microsoft.Crm.Metadata.EntityMetadataNotFoundException: The entity with a name = 'RecordCountSnapshot' was not found in the MetadataCache.
at Microsoft.Crm.Metadata.DynamicMetadataCache.GetEntity(String entityName, NameMappingType mapping)
at Microsoft.Crm.BusinessEntities.BusinessEntityCollection.get_EntityMetadata()
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.FillEntityCollectionFromDataReader(BusinessEntityCollection entities, IDataReader reader, EntityExpression entityExp, Boolean useEntityExpression, String aggregateLimitExceededName, Boolean quickFindRecordLimitCheckRequired, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.QueryAndFillEntityCollection(CrmDbConnection dbConnection, IDbCommand dbCommand, BusinessEntityCollection entities, EntityExpression entityExp, PagingHelper pagingHelper, Boolean useEntityExpression, String aggregateLimitExceededName, ExecutionContext context)
at Microsoft.Crm.BusinessEntities.BusinessProcessObject.DoRetrieveMultiple(BusinessEntityCollection entities, EntityExpression entityExp, DatabaseQueryTarget queryTarget, PagingHelper pagingHelper, ExecutionContext context)