Error in GetOpenOrdersForCustomerAsync

Hi all,

I’m currently upgrading a large Vendr project (Umbraco 10) to Umbraco Commerce 17. But whenever I call:

var openOrders = await _orderService.GetOpenOrdersForCustomerAsync(StoreId, CustomerReference);
(the StoreId & CustomerReference are correct)

I get the following message:

This exception was originally thrown at this call stack:
Umbraco.Commerce.Infrastructure.Resiliency.PollyExecutionStrategyBase.ExecuteAsync<TResult>(System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<TResult>>, System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<Umbraco.Commerce.Common.Resiliency.ExecutionResult<TResult>>>, System.Threading.CancellationToken)
Umbraco.Commerce.Core.Services.OrderService.PerformGetAllStatesAsync(System.Guid[])
Umbraco.Commerce.Core.Services.OrderService.GetOrdersAsync(System.Guid[])
Umbraco.Commerce.Core.Services.OrderService.GetOrdersForCustomerAsync(System.Guid, string, bool?)
Umbraco.Commerce.Core.Services.OrderService.GetOpenOrdersForCustomerAsync(System.Guid, string)
Repository.Services.CartService.GetOpenOrdersForCustomer(System.Guid, string) in CartService.cs

Any ideas?

Dave

Hi Dave, it looks like the issue is happening somewhere inside Umbraco Commerce’s resilient execution layer rather than with your parameters—the PollyExecutionStrategyBase stack trace usually points to a failed database or service call that’s being retried. Even if your StoreId and CustomerReference are correct, the query for open orders can fail if there’s a mismatch https://tropical-casino.com/ in states, missing related data, or a migration issue from Vendr to Commerce 17. I’d start by checking that the order states exist in the new Commerce setup and that your customer references are correctly mapped. Also, enabling detailed logging for the execution strategy can show the underlying exception that’s being swallowed during retries, which usually reveals the real cause.

Hi Sehag,

Thanks for your response. It doesn’t seem that it has anything to do with the order states etc. They are all available and have the same keys

Dave