Thursday, July 26, 2018

Sitecore Experience Commerce - Site publish to web fails with 401 error

When trying to perform a site publish (to the web database) on a Sitecore instance with Experience Commerce installed, the following error occurred part way through the publishing process.

Sitecore Experience Commerce - 401 on site publish
Job started: Publish to 'web'|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.OData.Client.DataServiceQueryException: An error occurred while processing this request. ---> Microsoft.OData.Client.DataServiceClientException: Status Code: 401; Unauthorized    at Microsoft.OData.Client.BaseAsyncResult.EndExecute[T](Object source, String method, IAsyncResult asyncResult)   at Microsoft.OData.Client.QueryResult.EndExecuteQuery[TElement](Object source, String method, IAsyncResult asyncResult)
Looking in the commerce engine showed:
51 08:17:14 ERROR ClientCertificateValidationMiddleware: Certificate with thumbprint 1D59F02B4279CB000588E905D7162499599632E3 does not have a matching Thumbprint.51 08:17:14 INFO ClientCertificateValidationMiddleware: Certificate with thumbprint 1D59F02B4279CB000588E905D7162499599632E3 is not valid.
This one comes back to our old friend the certificate thumbprint. This is sewt by default in the App_Config/Include/Y.Commerce.Engine/Sitecore.Commerce.Engine.Connect.config configuration file (but of course should be patched). Setting this value to the thumbprint used on the certificate assigned to the commerce engine should allow the publish to proceed.

No comments:

Post a Comment