Add product with kit part to cart = system falls over

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Add product with kit part to cart = system falls over

Post by Si Burgess » Thu Jul 30, 2009 3:55 am

Hi all,

AbleCommerce 7.0.3 build 12458

I have a product with 1 option (colour) a 5 kitting options, some of those options have 5 products assigned.

I can add the product with a selected colour option to the cart with no problems. As soon as I select a kit option and click 'add to cart' then I see the processing pop-up for about 20-30 seconds, nothing gets added to the cart, in Firefox I get the 'Opps, something went wrong' page, I get logged out of the admin interface (seems the site has crashed) and no error is shown in the logs. In IE the processing pop-up just disappears and the cart is not updated, I still get logged out of the admin section.

All the products in the kit options are in stock.

Today, I'm also not able to access the site from the 'Store' link from the admin. If do this I get logged out of the admin interface. A symptom of another problem?

The only thing I have changed is the web.config culture to show British date formats, as below. Changing this back to "en-US" the problems still occurs.

<globalization culture="en-GB" uiCulture="en-GB" />

Any ideas?

Thanks,
Si
Last edited by Si Burgess on Thu Jul 30, 2009 7:35 am, edited 1 time in total.

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Fri Jul 31, 2009 12:54 am

Found the problem. If you have Global Volume Discount then you can't add the kitted product with a kit option selected. I have raised a case for this as I think this is a bug.

Removing the volume discount allows you to add the product to the cart but without any discount.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Add product with kit part to cart = system falls over

Post by mazhar » Fri Jul 31, 2009 7:44 am

I have created product, volume discount and also made change to web.config for culture, but unable to reproduce it. Its working for me. Please have a look at screen capture.

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Fri Jul 31, 2009 11:42 am

In my case I have created and supplied a user account for you guys so you can see the config and what happens.

You can try this by going to: http://www.topprops.co.uk/SebArt-Angel-50E-P43.aspx. Can you add the product with kit options to the cart?

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Add product with kit part to cart = system falls over

Post by sohaib » Sat Aug 01, 2009 1:20 am

Can you reproduce this on a standard un-customized store?
Could this be because of some of your customizations?

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 1:40 am

Mazhar has made the same customizations to his install that I have made and it works for him. The problem is on my server.

Please can you go to the URL, http://www.topprops.co.uk/SebArt-Angel-50E-P43.aspx, select a product colour, one other another component and try adding it to the cart. For me the selection never makes it into the cart and the site falls over, in Firefox see the 'Opps' error page and no error gets logged.

If I remove the global volume discount everything works ok but I do need to have this feature working for my site launch.

Have raised case #5001 for this but hasn't been looked by Able at as of yet.

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Add product with kit part to cart = system falls over

Post by sohaib » Sat Aug 01, 2009 2:01 am

You can disable custom error pages in your web.config ... then it will show the error details on the page itself.

Code: Select all

<customErrors mode="On" defaultRedirect="~/Errors/GeneralError.aspx">
		<error statusCode="404" redirect="~/Errors/PageNotFound.aspx" />
</customErrors>
change to

Code: Select all

<customErrors mode="Off" defaultRedirect="~/Errors/GeneralError.aspx">
		<error statusCode="404" redirect="~/Errors/PageNotFound.aspx" />
</customErrors>

User avatar
sohaib
Developer
Developer
Posts: 1079
Joined: Fri Jan 23, 2004 1:38 am

Re: Add product with kit part to cart = system falls over

Post by sohaib » Sat Aug 01, 2009 2:02 am

Also check error log in App_Data/Logs/app.log file

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 2:12 am

I have reverted my one change to show the stock level for items that allow backorder in BuyProductDialog.ascx.cs and the problem still occurs.

As I said there is no error logged when the site falls over (all users get logged out) when adding this type of product with the global volume discount.

There is one error that is logged once or twice every day in app.log which seems to be Google trying to reference an out of date script resource:

ERROR 2009-08-01 09:11:58,836 148500ms Object a - An error has occured at http://www.topprops.co.uk/ScriptResourc ... t=34cc0a4c
System.Web.HttpException: This is an invalid script resource request. ---> System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount)
at System.Security.Cryptography.CryptoStream.FlushFinalBlock()
at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo)
at System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType)
at System.Web.UI.Page.DecryptString(String s)
at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString)
--- End of inner exception stack trace ---
at System.Web.Handlers.ScriptResourceHandler.DecryptParameter(NameValueCollection queryString)
at System.Web.Handlers.ScriptResourceHandler.ProcessRequestInternal(HttpResponse response, NameValueCollection queryString, VirtualFileReader fileReader)
at System.Web.Handlers.ScriptResourceHandler.ProcessRequest(HttpContext context)
at System.Web.Handlers.ScriptResourceHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 2:13 am

Have you tried the URL?

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 2:24 am

Changed the mode for custom errors in the web.config to off - now it fails silently with no error message or page. Nothing left in the logs.

Also tried this in all the browsers on my PC and my Mac and it fails everytime.

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 3:08 am

After looking at your logging routine in the Global.asax I see that it doesn't log Viewstate errors instead it returns out of the error handler. You should change that for default installs as that was why the error was failing silently.

After changing this so it logs the error before disregarding the error event, this is the error that it raised, seen it before?

ERROR 2009-08-01 10:44:29,711 2890ms Object a - An error has occured at http://www.topprops.co.uk/Product.aspx?ProductId=43
System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 90.207.143.248
Port: 51629
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.12) Gecko/2009070611 Firefox/3.0.12 (.NET CLR 3.5.30729)
ViewState: /wEPDwUKMTMwOTE0NDgwOA9kFgJmD2QWAgIDD2QWAgIFD2QWAgULU2hvd1Byb2R1Y3QPZBYIAg8PZBYCZg9kFgJmD2QWBAIBD2QWCAIBDw8WAh4HVmlzaWJsZWhkZAIDDw8WAh8AaGRkAgUPPCsADQEADxYGHg1TaG93V2hlbkVtcHR5aB4LXyFJdGVtQ291bnRmHgtfIURhdGFCb3VuZGdkZAIHDw9kDxAWAmYCARYCFgIeDlBhcmFtZXRlclZhbHVlBQI0MxYCHwRkFgICBAIDZGQCAw9kFgICAQ8PFgIeD0Zvcm1Jbml0aWFsaXplZGdkFgRmDw8WAh8AZ2RkAgIPDxYCHwBoZGQCEQ9kFgJmDxYCHwBoZAITD2QWAmYPZBYCZg9kFgQCAQ8PFgQeCENzc0NsYXNzBQtIaWRkZW5QYW5lbB4EXyFTQgICZBYCAgMPDxYEHwYFNGNvbnRlbnQgbm9mb290ZXIgbm9mb290ZXIgbm9mb290ZXIgbm9mb290ZXIgbm9mb290ZXIfBwICZBYEAgEPFgIfAGgWAgIND2QWAmYPZBYCZg9kFgICAQ8PFgIfAGhkFgICDQ8PFgQeBFRleHQFASoeB0VuYWJsZWRoZGQCAw8PFgIfAGdkZAIDDw8WBB8GBQxWaXNpYmxlUGFuZWwfBwICZBYCAgEPDxYCHwBoZBYCZg9kFgICAw88KwAJAGQCGQ9kFgICAQ8WAh8IBQ5FbWFpbCBBIEZyaWVuZGQYAgUnY3RsMDAkd3BtJFNob3dQcm9kdWN0JGN0bDA3JFJldmlld3NHcmlkDzwrAAoBCGZkBShjdGwwMCR3c... ---> System.Web.HttpException: Unable to validate data.
at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
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.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.product_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 4:51 am

i have added the machine as noted in viewtopic.php?f=42&t=7121&hilit=machinekey, it's brought down my site. I have a ticket in with my ISP to get it restarted.

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 6:22 am

IIS restarted. I no longer have the machineKey error but the issue is still occuring.

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 6:31 am

Tried to load the homepage and now I get "Service Unavailable" and I can't load any aspx, html page or image from the server. :(

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Re: Add product with kit part to cart = system falls over

Post by jmestep » Sat Aug 01, 2009 6:49 am

Did you restart the app pool? That is usually the problem when I get a server unavailable. Sometimes when moving a site from another server the app pool stops and I have to restart it.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Sat Aug 01, 2009 6:58 am

I had another ticket in with my hosting co to restart it for the 2nd time. Is now back up.

Found the bug...
If you create a "global" volume discount (just set the discount %, don't set any categories) then add a kitted product with a component selected to the cart it blows up the site. Looks like a infinate loop is occurring here as it ties up all the app pool resources and trashes IIS. The security error I was experiencing earlier was preventing part of this from happening. It also cases the line item prices to differ from the product prices in the cart. Whilst the total is calculated correctly the items are discounted and then another discount line is applied which just looks odd to the customer. One price on the page, different one in the cart and a wrong discount value that doesn't represent the discount percentage... just looks wrong and doesn't instil confidence to the customer.

The workaround...
Create a volume discount as before then assign it to specific product categories seems to work. Although the more categories you add to the rule the slower the site seems to get. If you add all of the categories then it trashes the site again.

Could I suggest you change the global.asax to log the viewstate errors before they are ignored by the app error event, my code:

Code: Select all

protected void Application_Error(Object sender, EventArgs e)
	{
        // ENABLE ERROR LOGGING FOR SCRIPTS OUTSIDE OF THE INSTALL DIRECTORY
        if (!HttpContextHelper.IsInstallRequest())
        {
            // RECORD THE DETAILS TO THE AC ERROR LOG
            HttpContext ctx = HttpContext.Current;
            Exception exception = ctx.Server.GetLastError();

            string errorInfo = "An error has occured at " + ctx.Request.Url.ToString();
            Logger.Error(errorInfo, exception);
            
            // IGNORE INVALID VIEW STATE ERRORS
            if (IsViewStateException(exception)) return;
        }
	}
Hope this helps someone.

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Add product with kit part to cart = system falls over

Post by Katie » Mon Aug 03, 2009 11:58 am

I've been testing this for awhile now and I think it's the combination of discount, kits, and taxes. If I disable tax in your store, it all starts working again. I don't think that all products in the kit are being taxed. (Kit is bundle style)

Also, the site is not crashing for me. I use IE7 and when I try to add the product to the basket, I get the processing image for 30 seconds or so, and then it just stops. The store continues to function without the IIS reset.

So, I think we can try again to reproduce this issue...

Katie
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

Si Burgess
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 35
Joined: Mon Jul 20, 2009 8:52 am

Re: Add product with kit part to cart = system falls over

Post by Si Burgess » Tue Aug 04, 2009 4:53 am

Thanks for looking at this Katie, I'm glad somebody else has experienced the issue.

IIS has fallen over when I've tried to add the kit in quick succession to the cart from different browsers. If you do once then IIS stays up. I've also been signed into the site at the time.

Post Reply