STACKTRACE:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Umbraco.Web.BaseRest.RestExtensionMethodInfo.Invoke(String[] parameters)
INNEREXCEPTION:
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at TeaCommerce.Api.Models.PriceCollection.Get(Int64 currencyId)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLine(Order order, OrderLine orderLine, VatRate fallbackVatRate)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLines(Order order)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrder(Order order)
at TeaCommerce.Api.Models.Order.Save()
at TeaCommerce.Api.Web.TeaCommerceHelper.EnsureThatCurrentOrderIsntChangedAfterItsLockedForPayment(Int64 storeId)
at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 properties)
at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 formFields, IDictionary`2 settings)
at TeaCommerce.Api.Web.FormPostHandler.FormPost()
at TeaCommerce.Umbraco.Web.RestExtensions.FormPost()]]>
Error 2
STACKTRACE:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at Umbraco.Web.BaseRest.RestExtensionMethodInfo.Invoke(String[] parameters)
INNEREXCEPTION:
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at TeaCommerce.Api.Models.PriceCollection.Get(Int64 currencyId)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLine(Order order, OrderLine orderLine, VatRate fallbackVatRate)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLines(Order order)
at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrder(Order order)
at TeaCommerce.Api.Models.Order.Save()
at TeaCommerce.Api.Web.PaymentProviders.PaymentMethodExtensions.GeneratePaymentForm(PaymentMethod paymentMethod, Order order, String submitInput)
at TeaCommerce.Api.Web.TeaCommerceHelper.GeneratePaymentForm(Int64 storeId, String submitInput)
at TeaCommerce.Api.Web.FormPostHandler.GeneratePaymentForm(Int64 storeId)
at TeaCommerce.Api.Web.FormPostHandler.FormPost()
at TeaCommerce.Umbraco.Web.RestExtensions.FormPost()]]>
Looks like there is an order line with multiple prices for the same currency. Could you try and check the order in the DB and see if that specify order line has multiple prices for the same currency?
TeaCommerce Posts Twice, intermittent fails
I have a TeaCommerce install where we post orders using the JavaScript API.
What we are seeing an intermittent issue where orders are not posted properly.
When the order fails, the products come through but all other data is missing including the customers email address.
What is even stranger is the server responds with a 500 when the order is successful and a 200 when the error happens.
I have checked the logs and there is nothing in there.
Please help!
TeaCommerce v2.3.2
Umbraco v6.1.6
Hi Laurence
Using session or cookie for saving the order? Try use cookie so your order wont reset when a new build is published.
Kind regards
Anders
Hey Anders, the site is currently using Cookies and not part of continuous integration so it's not restarting very often.
It's possible to recreate the error by posting multiple times in the same session.
The post is happening when TC.generatePaymentForm({ storeId: 1 }); is called.
Occasionally seeing these two errors:
STACKTRACE: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Umbraco.Web.BaseRest.RestExtensionMethodInfo.Invoke(String[] parameters)
INNEREXCEPTION: System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1 source, Func
2 predicate) at TeaCommerce.Api.Models.PriceCollection.Get(Int64 currencyId) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLine(Order order, OrderLine orderLine, VatRate fallbackVatRate) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLines(Order order) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrder(Order order) at TeaCommerce.Api.Models.Order.Save() at TeaCommerce.Api.Web.TeaCommerceHelper.EnsureThatCurrentOrderIsntChangedAfterItsLockedForPayment(Int64 storeId) at TeaCommerce.Api.Web.TeaCommerceHelper.AddOrUpdateOrderProperties(Int64 storeId, IDictionary2 properties) at TeaCommerce.Api.Web.FormPostHandler.AddOrUpdateOrderProperties(Int64 storeId, IDictionary
2 formFields, IDictionary`2 settings) at TeaCommerce.Api.Web.FormPostHandler.FormPost() at TeaCommerce.Umbraco.Web.RestExtensions.FormPost()]]>STACKTRACE: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at Umbraco.Web.BaseRest.RestExtensionMethodInfo.Invoke(String[] parameters)
INNEREXCEPTION: System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable
1 source, Func
2 predicate) at TeaCommerce.Api.Models.PriceCollection.Get(Int64 currencyId) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLine(Order order, OrderLine orderLine, VatRate fallbackVatRate) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrderLines(Order order) at TeaCommerce.Api.PriceCalculators.OrderCalculator.CalculateOrder(Order order) at TeaCommerce.Api.Models.Order.Save() at TeaCommerce.Api.Web.PaymentProviders.PaymentMethodExtensions.GeneratePaymentForm(PaymentMethod paymentMethod, Order order, String submitInput) at TeaCommerce.Api.Web.TeaCommerceHelper.GeneratePaymentForm(Int64 storeId, String submitInput) at TeaCommerce.Api.Web.FormPostHandler.GeneratePaymentForm(Int64 storeId) at TeaCommerce.Api.Web.FormPostHandler.FormPost() at TeaCommerce.Umbraco.Web.RestExtensions.FormPost()]]>Hi Laurence
Looks like there is an order line with multiple prices for the same currency. Could you try and check the order in the DB and see if that specify order line has multiple prices for the same currency?
Kind regards
Anders
is working on a reply...