Developer forum

Forum » Ecommerce - Standard features » Error makes the entire server crash :-/

Error makes the entire server crash :-/

Alexander P.
Reply

Hi everybody,

I have a recurring problem, which only happens "sometimes", but when it occurs, it causes the entire DynamicWeb site to crash for a while (until IIS manages to get back on its feet). I have attached a PDF-printout of the error, which is displayed in the browser.

I also saw the following three entries in the error log around the same time:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 09-09-2015 15:59:59
Event time (UTC): 09-09-2015 13:59:59
Event ID: b029232477cb4d989f42fa2f3b660aff
Event sequence: 24
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/1/ROOT-1-130862807157239398
    Trust level: Full
    Application Virtual Path: /
    Application Path: E:\dynamicweb.net\Solutions\vindereklame.net.dynamicweb.dk\Application\
    Machine name: DCMS-D402
 
Process information:
    Process ID: 3008
    Process name: w3wp.exe
    Account name: IIS APPPOOL\ASP.NET v4.0
 
Exception information:
    Exception type: InvalidOperationException
    Exception message: This SqlTransaction has completed; it is no longer usable.
   at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Commit()
   at Dynamicweb.DataManager.Dispose(Boolean disposeManagedObjects)
   at Dynamicweb.DataManager.Dispose()
   at Dynamicweb.eCommerce.Orders.OrderLineCollection.Save(String OrderID)
   at Dynamicweb.eCommerce.Orders.Order.SaveOrder(String IDStr, Boolean saveOldVersion)
   at Dynamicweb.eCommerce.Orders.Order.Save(String IDStr, Boolean saveOldVersion)
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.SaveCart()
   at Dynamicweb.eCommerce.Common.Context.SetCart(Order cart)
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.LoadCart()
   at Dynamicweb.eCommerce.Common.Context.get_Cart()
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.CatchCart(Int32 pageId, PageView Pageview)
   at Dynamicweb.eCommerce.Frontend.EcomPageLoadNotificationSubscriber.LoadedPage(PageView page)
   at Dynamicweb.Frontend.PageView.SetID()
   at Dynamicweb.Frontend.PageView.Load()
   at Dynamicweb.Frontend.PageviewControl.get_Pageview()
   at Dynamicweb.Frontend.PageviewControl..ctor()
   at Dynamicweb.Admin.DefaultAspx.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 
 
Request information:
    Request URL: http://teenstyle.dk/Default.aspx?ID=3748
    Request path: /Default.aspx
    User host address: 93.160.86.123
    User:  
    Is authenticated: False
    Authentication Type:  
    Thread account name: IIS APPPOOL\ASP.NET v4.0
 
Thread information:
    Thread ID: 18
    Thread account name: IIS APPPOOL\ASP.NET v4.0
    Is impersonating: False
    Stack trace:    at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Commit()
   at Dynamicweb.DataManager.Dispose(Boolean disposeManagedObjects)
   at Dynamicweb.DataManager.Dispose()
   at Dynamicweb.eCommerce.Orders.OrderLineCollection.Save(String OrderID)
   at Dynamicweb.eCommerce.Orders.Order.SaveOrder(String IDStr, Boolean saveOldVersion)
   at Dynamicweb.eCommerce.Orders.Order.Save(String IDStr, Boolean saveOldVersion)
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.SaveCart()
   at Dynamicweb.eCommerce.Common.Context.SetCart(Order cart)
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.LoadCart()
   at Dynamicweb.eCommerce.Common.Context.get_Cart()
   at Dynamicweb.eCommerce.Frontend.Cart.CartCatch.CatchCart(Int32 pageId, PageView Pageview)
   at Dynamicweb.eCommerce.Frontend.EcomPageLoadNotificationSubscriber.LoadedPage(PageView page)
   at Dynamicweb.Frontend.PageView.SetID()
   at Dynamicweb.Frontend.PageView.Load()
   at Dynamicweb.Frontend.PageviewControl.get_Pageview()
   at Dynamicweb.Frontend.PageviewControl..ctor()
   at Dynamicweb.Admin.DefaultAspx.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
 
 
Custom event details:

 

----------------------------------------------------------------------------------------------------------------------------- FOLLOWING ENTRY:

An unhandled exception occurred and the process was terminated.

Application ID: /LM/W3SVC/1/ROOT

Process ID: 3008

Exception: System.InvalidOperationException

Message: This SqlTransaction has completed; it is no longer usable.

StackTrace:    at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Commit()
   at Dynamicweb.DataManager.Dispose(Boolean disposeManagedObjects)
   at Dynamicweb.DataManager.Finalize()

 

----------------------------------------------------------------------------------------------------------------------------- FOLLOWING ENTRY:

Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.InvalidOperationException
Stack:
   at System.Data.SqlClient.SqlTransaction.ZombieCheck()
   at System.Data.SqlClient.SqlTransaction.Commit()
   at Dynamicweb.DataManager.Dispose(Boolean)
   at Dynamicweb.DataManager.Finalize()

 

This is the current DW information:

Content version 20.5.1.19
Assembly versions
Dynamicweb.dll 8.5.1.19
8.5.1.19 Dynamicweb, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null
Dynamicweb.Admin.dll 8.5.1.19
Dynamicweb.Admin, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null
Dynamicweb.Controls.dll 8.5.1.19
Dynamicweb.Controls, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null
Build date ma, 30 mar 2015 15:54
.NET Runtime version v4.0.30319 (4.0.30319.34209) (NP: 34209)
Application bit version 32Bit
OS type x86 (Microsoft Windows NT 6.2.9200.0)

 

IIS 
Version Microsoft-IIS/8.0
IIS Name --erased by me--
Application pool ASP.NET v4.0 (Integrated)
404 Handler C:\inetpub\custerr\en-US\404.htm

 

The solution is hosted with HostNordic as a dedicated custom server, however I believe the custom code does not play a role in this case.

 


Replies

 
Alexander P.
Reply

As a side-note, I changed the app pool from 32-bit to 64-bit today, and the error has since occurred again.

 
Nicolai Høeg Pedersen
Reply

Hi Alexander

I cannot see what the issue is. Is it always this exact exception you have in event viewer? Is it always the exact same stack?

What custom code do you have - this example has something to do with orders - do you by any chance manipulate the order in custom code?

BR Nicolai

 
Alexander P.
Reply

Hi Nicolai

The exception is always of the same type, if we are referring to this program... Although it may come up in other places, besides this one, such as the Admin eCom Backend, for instance, where the exception's stack trace is sure to be different. However, the top elements of the stack trace are consistent, i.e. the method signature Dynamicweb.DataManager.Dispose(Boolean disposeManagedObjects) is always present, which leads me to believe, that the disposal code causes trouble in some particular states of the SQL connection. You can also check the attached .pdf file to the original post, if you haven't done so.

The order in question is still a cart, so the only custom code, which manipulates it, is part of Sales Discount Providers (or NotificationSubscribers for various order events, which for example might edit an order Custom Field before save), which have been developed based on the tutorials. I generally try to change as little as possible in the DynamicWeb data, because I am usually worried about messing something up on the DynamicWeb side.

Best Regards,
Alexander

 

 
Nicolai Høeg Pedersen
Reply

Hi Alexander

Weird issue. It seems like we could have a bug in the dispose method - it will commit the transaction if not committed yet. But it could be that both Finalize and Dispose are sometimes called giving the issue. We will fix it on 8.7 branch.

BR Nicolai

 
Alexander P.
Reply

Hi Nicolai

I believe you are right, it seems like something goes wrong there.
I also think it is worth altering the Dispose method to check if the connection is still open (and maybe if the transaction has not been rolled back by a thrown exception), before committing the transaction.

On a side-note, I have seen a lot of decompiled code in the DynamicWeb binaries, which does not utilise a using block when working with database connections (and which does not use the DataManager), but instead calls Close/Dispose at the end (and hopes no exception gets thrown). It might be worth taking a look at that as well.

Best Regards,
Alexander

 

You must be logged in to post in the forum