0

What can cause the following error log when retrieving stock information from the Commerce Engine?

00186 04:18:52 ERROR ClientCertificateValidationMiddleware: Message = Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Sitecore.Commerce.Plugin.Inventory.ApiController.<GetBulkStockInformation>d__1.MoveNext()

Is it related to client certificate or can it be any error during processing of the GetBulkStockInformation?

1 Answer 1

1

I think it should not be related to client certificate.

Here is the section of code from client certificate validation middleware (taken from XC 9.2):

enter image description here

Notice there are two try/catch blocks, first catch block will be executed for certificate error or some other error. If response code is 401 then error is related to certificate otherwise not.

Second try/catch block is only related to processing of next middleware (which will be commerce engine api call such as GetBulkStockInformation).

If you are using XC 9.2 then error message you mentioned above must be coming from the second try/catch block and it can be any error during processing of the GetBulkStockInformation.

2
  • Thanks for the reply. It is helpful. It is an XC 9.1 version. In that version there is only one try/catch block where there is no difference made between a 401 and 500 and on each exception it will be a 401. Based on your answer this means it can be any error during processing of the GetBulkStockInformation.
    – James
    Feb 26, 2020 at 13:09
  • yes in XC 9.1 also it can be any error during processing of the GetBulkStockInformation or any other middleware after this client certificate validation middleware. Feb 26, 2020 at 14:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.