Order API Error

Vote:
 

Hi All,

We are continuously tracking the below error in our production environment error log file. We can not reproduce this in any other environment. Seems the error threws in the EPiServer Order  API.

What can be the cause?  Can someone help us to resolve this error?

2018-08-21 00:15:02,048 [98] ERROR EPiServer.Global: 1.2.5 Unhandled exception in ASP.NET
System.NullReferenceException: Object reference not set to an instance of an object.
   at EPiServer.Commerce.Order.Internal.CartProvider.Delete(OrderReference orderLink)
   at EPiServer.Commerce.Order.DefaultOrderRepository.Delete(OrderReference orderLink)
   at EPiServer.Commerce.Order.Internal.CartMigrator.MigrateCarts(Guid sourceCustomerId, Guid destinationCustomerId)
   at EPiServer.Business.Commerce.HttpModules.ProfileModule.MigrateCarts(CustomerContact contact, String anonymousId)
   at EPiServer.Business.Commerce.HttpModules.ProfileModule.Profile_MigrateAnonymous(Object sender, ProfileMigrateEventArgs pe)
   at System.Web.Profile.ProfileModule.OnEnter(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
System.NullReferenceException: Object reference not set to an instance of an object.
   at EPiServer.Commerce.Order.Internal.CartProvider.Delete(OrderReference orderLink)
   at EPiServer.Commerce.Order.DefaultOrderRepository.Delete(OrderReference orderLink)
   at EPiServer.Commerce.Order.Internal.CartMigrator.MigrateCarts(Guid sourceCustomerId, Guid destinationCustomerId)
   at EPiServer.Business.Commerce.HttpModules.ProfileModule.MigrateCarts(CustomerContact contact, String anonymousId)
   at EPiServer.Business.Commerce.HttpModules.ProfileModule.Profile_MigrateAnonymous(Object sender, ProfileMigrateEventArgs pe)
   at System.Web.Profile.ProfileModule.OnEnter(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Suggestions and solutions are much appreciated.

Thanks,

Ananth

#196192
Edited, Aug 21, 2018 17:41
Vote:
 

Hi Mathan,

Does this happen when migrating cart (anonymous user -> loggedin user)?
And which Commerce version are you using? Have you recently upgraded Commerce version?

Regards,

Viet Anh

#196208
Aug 22, 2018 9:23
Vote:
 

Viet,

We are running on 10.2.1. We are not upgrade the commerce yet.

<package id="EPiServer.Commerce" version="10.2.1" targetFramework="net452" />

And we are not having cart access for an anonymous user.

#196220
Edited, Aug 22, 2018 10:44
Vote:
 

That's strange, because regarding to the basic flow, this code is called when migrating cart from anonymous user to logged in user.

Could you please check Commerce Manager if any anonymous cart exists?

#196231
Aug 22, 2018 12:10
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.