2017-03-13 7 views
5

CRM 2013オンプレミスをCRM365にアップグレードした後、プラグインの問題が発生し始めました。 IOrganizationServiceをプラグインから任意の操作で使用しようとするたびに、エラーが発生します。 この問題は、マルチサーバーのインストールでのみ発生し、CRM 2013バージョンでは発生しませんでした。また、CRM365の単一サーバのインストールでは発生しません。CRM 365プラグインのcallManagerInfoエラー

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #52BFF7F3Detail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> 
    <ActivityId>c291f3ee-3bfe-4c0d-a631-9b7e70c19add</ActivityId> 
    <ErrorCode>-2147220970</ErrorCode> 
    <ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> 
    <Message>System.Web.HttpUnhandledException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #52BFF7F3</Message> 
    <Timestamp>2017-03-13T12:14:25.2768854Z</Timestamp> 
    <ExceptionSource i:nil="true" /> 
    <InnerFault> 
    <ActivityId>c291f3ee-3bfe-4c0d-a631-9b7e70c19add</ActivityId> 
    <ErrorCode>-2147220891</ErrorCode> 
    <ErrorDetails xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" /> 
    <Message>callManagerInfo</Message> 
    <Timestamp>2017-03-13T12:14:25.2768854Z</Timestamp> 
    <ExceptionSource i:nil="true" /> 
    <InnerFault i:nil="true" /> 
    <OriginalException i:nil="true" /> 
    <TraceText> 

[PluginsMerged: Core.Plugins.ReadAuditLogPlugin] 
[b381844a-41b5-e611-b605-0050568c2255: Core.Plugins.ReadAuditLogPlugin: RetrieveMultiple of account] 

Entered Core.Plugins.ReadAuditLogPlugin.Execute(), Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Core.Plugins.ReadAuditLogPlugin is firing for Entity: account, Message: RetrieveMultiple, Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered internal execute in ReadAuditLogService., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
EnsureInitialized., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered GetMessage., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered GetUserFromPlugin., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
user 21391658-381b-e511-80e0-005056931145., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Before context.OrganizationService.Retrieve., Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
callManagerInfo, Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 
Exiting Core.Plugins.ReadAuditLogPlugin.Execute(), Correlation Id: 0a738a82-3329-4f60-a6b3-ea8230290d19, Initiating User: 21391658-381b-e511-80e0-005056931145 


</TraceText> 
    </InnerFault> 
    <OriginalException i:nil="true" /> 
    <TraceText i:nil="true" /> 
</OrganizationServiceFault> 

この例外がスローされるコードは次のとおり

private User GetUserFromPlugin(ILocalPluginContext context) 
{ 
    context.Trace("Entered GetUserFromPlugin."); 
    var userId = context.PluginExecutionContext.UserId; 
    context.Trace(string.Format("user {0}.", userId)); 

    context.Trace("Before context.OrganizationService.Retrieve."); 
    if (context.OrganizationService == null) 
    { 
     var organizationServiceNullMessage = "OrganizationService is null"; 
     context.Trace(organizationServiceNullMessage); 
     throw new InvalidPluginExecutionException(organizationServiceNullMessage); 
    } 

    var systemUser = context.OrganizationService.Retrieve(
     EntityNames.CRMSystemUser, 
     userId, 
     new ColumnSet(FieldNames.CRMSystemUser.DomainName, FieldNames.CRMSystemUser.LastName, FieldNames.CRMSystemUser.FirstName)); 
    context.Trace("After context.OrganizationService.Retrieve."); 

    var user = new User 
    { 
     Id = userId, 
     DomainName = systemUser.ReadAttributeValue<string>(FieldNames.CRMSystemUser.DomainName), 
     FirstName = systemUser.ReadAttributeValue<string>(FieldNames.CRMSystemUser.FirstName), 
     LastName = systemUser.ReadAttributeValue<string>(FieldNames.CRMSystemUser.LastName), 
    }; 

    return user; 
} 

--------- EDIT ----------------

私は回避策は、Microsoftによって提供されています

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: callManagerInfoDetail: 
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts"> 
<ActivityId>dbe29fd8-651c-47d2-ad39-ed460552d4e1</ActivityId> 
<ErrorCode>-2147220891</ErrorCode> 
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic"> 
<KeyValuePairOfstringanyType> 
<d2p1:key>OperationStatus</d2p1:key> 
<d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int">0</d2p1:value> 
</KeyValuePairOfstringanyType> 
<KeyValuePairOfstringanyType> 
<d2p1:key>SubErrorCode</d2p1:key> 
<d2p1:value xmlns:d4p1="http://www.w3.org/2001/XMLSchema" i:type="d4p1:int">-2146233088</d2p1:value> 
</KeyValuePairOfstringanyType> 
</ErrorDetails> 
<Message>callManagerInfo</Message> 
<Timestamp>2017-03-14T06:09:08.1648164Z</Timestamp> 
<ExceptionSource>PluginExecution</ExceptionSource> 
<InnerFault i:nil="true" /> 
<OriginalException>Microsoft.Xrm.Sdk.InvalidPluginExecutionException 
at Core.Plugins.BusinessLogic.Service.ReadAuditLogService.Execute(ILocalPluginContext context) 
at Core.Plugins.ReadAuditLogPlugin.InternalExecute(LocalPluginContext context) 
at Plugins.Common.PluginBase.Execute(IServiceProvider serviceProvider) 
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.&lt;&gt;c__DisplayClass5.&lt;Execute&gt;b__0() 
--- End of stack trace from previous location where exception was thrown --- 
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, Dictionary`2 sandboxServices, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext) 
at Microsoft.Crm.Sandbox.SandboxAppDomainHelper.Execute(IOrganizationServiceFactory organizationServiceFactory, Dictionary`2 sandboxServices, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, IPluginExecutionContext requestContext) 
at Microsoft.Crm.Sandbox.SandboxWorker.Execute(SandboxCallInfo callInfo, SandboxPluginExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, SandboxRequestCounter&amp; workerCounter, Boolean returnTraceInfo)</OriginalException> 
<TraceText> 
Entered Core.Plugins.ReadAuditLogPlugin.Execute(), Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Core.Plugins.ReadAuditLogPlugin is firing for Entity: account, Message: RetrieveMultiple, Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered internal execute in ReadAuditLogService., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
EnsureInitialized., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered GetMessage., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Entered GetUserFromPlugin., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
user 21391658-381b-e511-80e0-005056931145., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Before context.OrganizationService.Retrieve., Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
callManagerInfo, Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
Exiting Core.Plugins.ReadAuditLogPlugin.Execute(), Correlation Id: 50b0f06c-fc66-40b3-acbd-69a2463be0f4, Initiating User: 21391658-381b-e511-80e0-005056931145 
</TraceText> 
</OrganizationServiceFault> 

Server stack trace: 
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
at Microsoft.Crm.Sandbox.ISandboxHost.ExecuteAndReturnTraceInfo(SandboxCallInfo callInfo, SandboxPluginExecutionContext requestContext, Guid pluginAssemblyId, Int32 sourceHash, String assemblyName, Guid pluginTypeId, String pluginTypeName, String pluginConfiguration, String pluginSecureConfig, String assemblyContents, Boolean returnTraceInfo) 
at Microsoft.Crm.Sandbox.SandboxPlugin.Execute(SandboxClient client, SandboxCallTracker callTracker, IExecutionContext requestContext, String assemblyContents, Boolean returnTraceInfo) 
at Microsoft.Crm.Sandbox.SandboxCodeUnit.Execute(IExecutionContext context) 
+0

'SystemUser'の' Retrieve'に2番目のプラグインが登録されていますか? 'callManagerInfo'の内部で何が起こっていますか?システム設定/カスタマイズからプラグイントレースを有効にしましたか?あなたは "予期しない例外"が発生しているので、(実行パイプ)行の下に何か間違ったものがあるようです。 – Filburt

+0

こんにちは。他のプラグインはリトリーブでは動作しませんが、このプラグインはすべてのプラグインがプラグインを起動しているメッセージを無視するためにスローされます。 callManagerInfoはいくつかのM $クラスであり、私はそれにアクセスできません。プラグイントレースから情報を投稿します。 – Maco

+0

[エラーコードリファレンス](https://msdn.microsoft.com/en-us/library/gg328182(v= crm.8))に従って、プラグイントレースからのサブエラーコード「-2146233088」(16進数80131500) .aspx)は、「Exchange OnlineでDynamics 365 OnpremiseのS2S認証に使用された証明書が期限切れになっている」と述べています*ので、この方向で調査したいことがあります。 – Filburt

答えて

4

をトレースするプラグインからの情報を追加しています。エラーを停止するには、 HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ MSCRMSandboxService \ SingleBox DWord値を0に設定します。これを実行すると、問題が解決しました。

+0

これは、負荷分散されたサーバーで機能しました。 – Postmita

関連する問題