R5-Sp1 Checkout random payment failures

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

R5-Sp1 Checkout random payment failures

Post by AbleMods » Fri Jul 26, 2013 7:33 am

We're seeing random failures to process a checkout and have no idea where to look. It's causing the site to be unable to accept orders both admin side and shopper side until the site is reset.

Here's what we do know:

1. We know having LiveAgent javascript chat in any section of the 4 checkout pages causes problems. We have removed it and have seen some improvement but the problem has not gone away. So we're not fully convinced this was an issue but have eliminated it as a possibility nonetheless.

2. We have not been able to determine a time of day or specific admin action that results in the behavior. It can happen in the morning, afternoon or evening.

3. User maintenance is not running at the time checkouts start failing.

4. Once the problem starts, it does not resolve itself. Only a restart of the app pool, restart of IIS or a reboot of the entire server resolves the issue.

5. The problem affects both admin-side and shopper-side ability to checkout. This is a key clue to the problem in my opinion.

Errors in the app.log seem to be the majority of these two examples. This one is from an admin trying to create order:
2013-07-26 08:30:53,003 ERROR AbleCommerce An error has occured at https://www.firefold.com/Admin/Orders/C ... ?UID=11977
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
at CommerceBuilder.DomainModel.EntityWithTypedId`1.Save()
at CommerceBuilder.Stores.StoreRepository.GetNextOrderNumber(Boolean increment)
at CommerceBuilder.Stores.StoreDataSource.GetNextOrderNumber(Boolean increment)
at CommerceBuilder.Services.Checkout.CheckoutService.ExecuteCheckout(CheckoutRequest checkoutRequest, Boolean validateBasket)
at AbleCommerce.Admin.Orders.Create.DeferPaymentForm.SubmitButton_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
And this one is from the shopper side during the same outage:
2013-07-26 08:36:23,817 ERROR AbleCommerce An error has occured at https://www.firefold.com/Checkout/Payment.aspx
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
at CommerceBuilder.DomainModel.EntityWithTypedId`1.Save()
at CommerceBuilder.Stores.StoreRepository.GetNextOrderNumber(Boolean increment)
at CommerceBuilder.Stores.StoreDataSource.GetNextOrderNumber(Boolean increment)
at CommerceBuilder.Services.Checkout.CheckoutService.ExecuteCheckout(CheckoutRequest checkoutRequest, Boolean validateBasket)
at AbleCommerce.ConLib.Checkout.PaymentForms.MailPaymentForm.MailButton_Click(Object sender, EventArgs e)
at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Fri Jul 26, 2013 9:21 am

This is R5?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Fri Jul 26, 2013 2:48 pm

Yes R5-SP1

p.s. not getting forum notifications today
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Sun Jul 28, 2013 5:27 pm

Baffeled about this one. No clue as why this could be happening. Anyway this is under investigation.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Sun Jul 28, 2013 5:47 pm

Code reviews and strack trace analysis reveals nothing to suspect.

One thing it observe is that probably something goes wrong with the IIS application pool. Possibily when the app not in an active app pool? A later access to the app fails to bring the app pool in correct active state?

Do your logs indicate that the problem starts after a period of inactivity?

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Mon Jul 29, 2013 3:42 am

No inactivity. The site takes 200 orders a day, so it's never slow enough for traffic to stall the app pool.

Always the checkout. Always the payment page. Never any other pages that update tables like basket, category pages etc.

Something is blowing up the ability to read or more likely write the next order number to store settings. Going to put a try catch around the checkout service so we can alert the client sooner.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 4:00 am

Do you have source for this project?

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 7:04 am

What is frustrating is not being able to reproduce this.

Its a shot in the dark but we suspect something wrong with store settings that are cached... but without being able to reproduce the bug there is no way to confirm.

If you have the source available for this project and you can make the following changes, it can help confirm our suspicion.

Store.cs has this code

Code: Select all

        public virtual StoreSettingsManager Settings
        {
            get
            {
                if (_settings == null)
                {
                    IStoreSettingsProvider provider = AbleContext.Resolve<IStoreSettingsProvider>();
                    _settings = provider.GetSettingsManager(this);
                }
                return _settings;
            }
        }

I propose changing it to

Code: Select all

        public virtual StoreSettingsManager Settings
        {
            get
            {
                if (_settings == null)
                {
                    _settings = new StoreSettingsManager(this);
                }
                return _settings;
            }
        }
Basically we are simply bypassing store settings provider which is responsible for caching the settings.

egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Re: R5-Sp1 Checkout random payment failures

Post by egormsen » Mon Jul 29, 2013 10:40 am

Not sure if this is related, but we seeing a similar error on the payment page our store. I noticed it this morning when check the logs. if looking into the log history it has happened about 50 times over the past month, but 45 of them happened over the weekend starting yesterday.
An error has occured at https://store.weighdown.com/Checkout/Payment.aspx
Exception: Exception of type 'System.Web.HttpUnhandledException' was thrown. Stack Trace: at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.checkout_payment_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\034f24bf\735d5c2b\App_Web_5m133ba0.14.cs:line 0 at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) Inner Exception: Value cannot be null. Parameter name: key Inner Exception Stack Trace: at CommerceBuilder.DomainModel.EntityWithTypedId`1.Save() at CommerceBuilder.Stores.StoreRepository.GetNextOrderNumber(Boolean increment) at CommerceBuilder.Services.Checkout.CheckoutService.ExecuteCheckout(CheckoutRequest checkoutRequest, Boolean validateBasket) at AbleCommerce.ConLib.Checkout.PaymentForms.CreditCardPaymentForm.CreditCardButton_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\store\ConLib\Checkout\PaymentForms\CreditCardPaymentForm.ascx.cs:line 243 at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Mon Jul 29, 2013 4:28 pm

ForumsAdmin wrote:If you have the source available for this project and you can make the following changes, it can help confirm our suspicion.
We have full source code. I will coordinate with the client to implement it. I will post here in a few days once we've had a chance to see it run for a while. The issue can happen 3 times in one day, or only once every 5 days.

Lately it's been more frequent.

p.s. Isn't that going to put quite a load on SQL if we disable caching the store settings for the entire site? These guys get quite a bit of traffic....
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 5:50 pm

Joe, Gold R4 did not have this caching for store settings and this was not a big performance issue in R4. There were other issues and when we were handling those issues, this one also got fixed along the way. But in fact it was not really that important to fix.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 5:51 pm

@egormsen
Your exception log looks similar to Joe's. I think they are both related.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Mon Jul 29, 2013 6:17 pm

I'm not sure I agree with the idea that store settings shouldn't be cached. There's no reason not to, assuming the cached data is not subject to rapid or frequent change.

NextOrderNumber is one of the few store settings than can (and does) change frequently on a high volume site. Perhaps there's a more cache-friendly place to store it than in the middle of 50 other settings that hardly ever change.

W've spent all this time and effort to build an API around speed and efficiency using a whole new design pattern. Seems silly to tap a 50-row table 10,000 times an hour when only 1 row will change in that same hour.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 6:54 pm

NextOrderNumber is not a store setting that is cached anyway. NextOrderNumber is stored directly ac_Stores table.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 7:04 pm

I'm not sure I agree with the idea that store settings shouldn't be cached.
We don't agree with it either but this is not the main concern right now. We first have to figure out if it actually is the caching of the store settings that is causing the issues above. If caching is not the cause to start with then having or not having the cache is pointless discussion.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Mon Jul 29, 2013 7:17 pm

Oh ok, I thought you were saying no more caching store settings, ever :)

Whew!
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 10:04 pm

One more thing can be done to get better error details. The actual exception trace is lost because exception is caught and rethrown in EntityWithTypedId.Save() method

Code: Select all

            try
            {
                saveMethod.Invoke(repo, new object[] { this });
            }
            catch (TargetInvocationException tiex)
            {
                if (tiex.InnerException != null) throw tiex.InnerException;
                throw;
            }
The above code if changed to the following will give us better exception stack trace

Code: Select all

          saveMethod.Invoke(repo, new object[] { this });
Joe - If you can make this change to your code it would be great for debugging. Your help is greatly appreciated. On our local systems, all our efforts to reproduce the bug have failed.

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Mon Jul 29, 2013 10:21 pm

To help us reproduce this please report
- IIS Version
- .NET version
- App Pool configurations
- AC Gold deployment mode (Web site or web application)

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Wed Jul 31, 2013 2:30 pm

ForumsAdmin wrote:To help us reproduce this please report
- IIS Version
- .NET version
- App Pool configurations
- AC Gold deployment mode (Web site or web application)
IIS 7.5
ASP.Net 4.0 Integrated
Website Deployment

Updates have been deployed. Will update here after we've had some time to see how it goes.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Wed Jul 31, 2013 6:35 pm

IIS 7.5
ASP.Net 4.0 Integrated
Website Deployment
This is one of the common configurations that we test. Wonder why we never saw something that has been reported by at least two users.

acuser777
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 28
Joined: Sat May 16, 2009 8:39 pm

Re: R5-Sp1 Checkout random payment failures

Post by acuser777 » Wed Jul 31, 2013 7:09 pm

Exact same problem. Working with AbleCommerce through support ticket.

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: R5-Sp1 Checkout random payment failures

Post by AbleMods » Wed Jul 31, 2013 7:33 pm

This install is CLR 4.0.30319.1008 on Server 2008 R2
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Re: R5-Sp1 Checkout random payment failures

Post by egormsen » Thu Aug 01, 2013 8:50 am

Problems happened again this morning. Customers and our customer service reps both could not place orders. This time restarting app pool and restarting the website site did not work. Had to make a change that forced a recompile.

Our environment looks about the same as Joes
Windows Server 2008 R2
IIS 7.5
app pool is set as ASP.Net 4.0 Integrated 4.0.30319
Website Deployment

We do not have full source so I can not do your earlier suggestion. If there is something I can do to help narrow this problem down please let me know.
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

User avatar
ForumsAdmin
AbleCommerce Moderator
AbleCommerce Moderator
Posts: 399
Joined: Wed Mar 13, 2013 7:19 am

Re: R5-Sp1 Checkout random payment failures

Post by ForumsAdmin » Thu Aug 01, 2013 11:12 pm

Can you please share your full app.log file?

egormsen
Captain (CAPT)
Captain (CAPT)
Posts: 236
Joined: Fri May 16, 2008 9:16 am

Re: R5-Sp1 Checkout random payment failures

Post by egormsen » Fri Aug 02, 2013 1:59 pm

Here it is
Eldon Gormsen
Weigh Down Ministries
AC Gold R12 SR1
http://store.weighdown.com

Post Reply