xConnect証明書の問題のトラブルシューティング


概要

この記事では、xConnect証明書の問題をトラブルシューティングするためのステップ・バイ・ステップのシナリオについて記載しています。

この問題の症状として、xConnect証明書に関するエラーがログ ファイルに出力されたり、エクスペリエンス アナリティクスのUIに次のようなエラーが表示される場合があります。The following error appear in Experience Analytics application

シナリオ1:サーバー証明書の問題

症状:

解決策:

ブラウザを使用してxConnectインスタンスをリクエストします。証明書のプロンプトが表示された場合、プロンプトを閉じます。

接続が安全であることを確認します。

  1. 接続が安全な場合:
  2. 接続が安全ではなく、SitecoreとxConnect間の接続を確立できない場合:

接続が安全ではない場合、HTTPSサイト バインディングに使用されるサーバー証明書の有効期限が切れていないことを確認してください。また、証明書のIssued Toプロパティが使用するホスト名と一致することを確認してください。

 

 註:

証明書のサムプリントをMicrosoft 管理コンソール(MMC)アプリケーションからコピーする場合、最初から目に見えない記号が含まれている場合があります。そのような不可視の記号がある場合、Sitecore XP設定に証明書のサムプリントを適用する前に、手動で除去する必要があります。

 

シナリオ2:クライアント証明書の問題

症状:

以下のようなエラーがログに記録される場合があります。

[Experience Analytics]: Failed to synchronize segments. Message: The certificate was not found. Store: My, Location: CurrentUser, FindType: FindByThumbprint, FindValue: 83DCC21BBF54D76F71D7B67EA2319273BCDA8E10, InvalidAllowed: True.. Details:    at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
at Sitecore.ExperienceAnalytics.Core.Repositories.ReferenceData.ReferenceDataSegmentReader.GetAll(NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Aggregation.Repositories.AggregationSegmentReader.GetAll(NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Client.Deployment.SyncSegmentsManager.GetSegmentsToSynchronize()
at Sitecore.ExperienceAnalytics.Client.Deployment.SyncSegmentsManager.SynchronizeAllSegments()
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Sitecore.ExperienceAnalytics.Client.Deployment.SyncSegmentsProcessor.<process>d__4.MoveNext()
Exception System.InvalidOperationException: The certificate was not found. Store: My, Location: CurrentUser, FindType: FindByThumbprint, FindValue: 83DCC21BBF54D76F71D7B67EA2319273BCDA8E10, InvalidAllowed: True.
at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
at Sitecore.ExperienceAnalytics.Core.Repositories.ReferenceData.ReferenceDataSegmentReader.Get(IEnumerable`1 keys, NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Aggregation.Repositories.AggregationSegmentReader.Get(IEnumerable`1 keys, NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Api.RequestTypeResolver.GetReportSegments()
at Sitecore.ExperienceAnalytics.Api.RequestTypeResolver.GetRequestType()
at Sitecore.ExperienceAnalytics.Api.Http.ModelBinding.ReportQueryModelBinder.GetModelFromBindingContext(HttpActionContext actionContext, ModelBindingContext bindingContext)
at Sitecore.ExperienceAnalytics.Api.Http.ModelBinding.ReportQueryModelBinder.BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
at System.Web.Http.ModelBinding.ModelBinderParameterBinding.ExecuteBindingAsync(ModelMetadataProvider metadataProvider, HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.HttpActionBinding.<executebindingasynccore>d__12.MoveNext()
...
Exception System.InvalidOperationException: Ensure definition type did not complete successfully. StatusCode: 401, ReasonPhrase: 'Invalid certificate', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
Pragma: no-cache
Cache-Control: no-cache
Date: Thu, 02 Jan 2020 15:03:36 GMT
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Content-Length: 0
Expires: -1
}
at Sitecore.Xdb.Common.Web.Synchronous.SynchronousExtensions.SuspendContextLock[TResult](Func`1 taskFactory)
at Sitecore.ExperienceAnalytics.Core.Repositories.ReferenceData.ReferenceDataSegmentReader.Get(IEnumerable`1 keys, NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Aggregation.Repositories.AggregationSegmentReader.Get(IEnumerable`1 keys, NameValueCollection readingPreferences)
at Sitecore.ExperienceAnalytics.Api.RequestTypeResolver.GetReportSegments()
at Sitecore.ExperienceAnalytics.Api.RequestTypeResolver.GetRequestType()
at Sitecore.ExperienceAnalytics.Api.Http.ModelBinding.ReportQueryModelBinder.GetModelFromBindingContext(HttpActionContext actionContext, ModelBindingContext bindingContext)
at Sitecore.ExperienceAnalytics.Api.Http.ModelBinding.ReportQueryModelBinder.BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext)
at System.Web.Http.ModelBinding.ModelBinderParameterBinding.ExecuteBindingAsync(ModelMetadataProvider metadataProvider, HttpActionContext actionContext, CancellationToken cancellationToken)
at System.Web.Http.Controllers.HttpActionBinding.<executebindingasynccore>d__12.MoveNext()
...

解決策:

  1. SitecoreXPロールの接続文字列の証明書のサムプリント(拇印)が、使用中の証明書のサムプリントと一致していることを確認します。
    <add name="xconnect.collection.certificate" 
    connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue=83DCC21BBF54D76F71D7B67EA2319273BCDA8E19" />
    <add name="sitecore.reporting.client.certificate" 
    connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue=83DCC21BBF54D76F71D7B67EA2319273BCDA8E19" />
    <add name="xdb.marketingautomation.operations.client.certificate" 
    connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue=83DCC21BBF54D76F71D7B67EA2319273BCDA8E19" />
    <add name="xdb.marketingautomation.reporting.client.certificate" 
    connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue=83DCC21BBF54D76F71D7B67EA2319273BCDA8E19" />
    <add name="xdb.referencedata.client.certificate" 
    connectionString="StoreName=My;StoreLocation=CurrentUser;FindType=FindByThumbprint;FindValue=83DCC21BBF54D76F71D7B67EA2319273BCDA8E19" />
  2. xConnectおよびMarketing AutomationロールのvalidateCertificateThumbprint値が使用中の証明書のサムプリントと一致していることを確認します。この設定は次のファイルにあります:\App_Config\AppSettings.config
  3. AutomationEngineジョブのxconnect.collection.certificate接続文字列に正しい証明書のサムプリントがあることを確認します:
    \App_Data\jobs\continuous\AutomationEngine\App_Config\ConnectionStrings.config
  4. [Sitecore XP 9.1+の場合]ProcessingEngineのxconnect.collection.certificate、xconnect.configuration.certificateおよびxconnect.search.certificate接続文字列に正しい証明書のサムプリントがあることを確認します: \App_Data\jobs\continuous\ProcessingEngine\App_Config\ConnectionStrings.config
  5. 証明書が自己署名されている場合、Sitecore XPロールでAllowInvalidClientCertificatesアプリケーションの設定がtrueであることを確認します(この設定は、デフォルトでWeb.configファイルにあります):
    <add key="AllowInvalidClientCertificates" value="True" />
  6. 証明書が自己署名されている場合、xConnectロールでAllowInvalidClientCertificatesアプリケーションの設定がtrueであることを確認します。この設定は、デフォルトで次のファイルにあります: 
    \App_Config\AppSettings.config
    \App_Data\jobs\continuous\JOB_NAME_GOES_HERE\App_Config\AppSettings.config

註: 設定のサムプリントの値は、大文字である必要があります。

ソリューションの実装に応じて、以下のいずれかを実施します。