TransactionAbortedException every now and then

Topics: Troubleshooting
Developer
Nov 2, 2011 at 11:45 AM

Every now and then, my site throws an TransactionAbortedException. After refreshing the page, the error doesn't occur.
I don't know how to reproduce the error, it just sometimes happens.



Here are a few log entries from Event Viewer:

Application information: 
    Application domain: /LM/W3SVC/8/ROOT-21-129646936342560999 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\Websites\OLG\onlineleadsgroup.nl\wwwroot\ 
    Machine name: ZRWN002 
 
Process information: 
    Process ID: 5184 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 
 
Exception information: 
    Exception type: TransactionAbortedException 
    Exception message: The transaction has aborted.
   at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36

Transaction Timeout

 
 
Request information: 
    Request URL: http://onlineleadsgroup.nl/Admin/Contents/List 
    Request path: /Admin/Contents/List 
    User host address: 193.173.23.201 
    User: admin 
    Is authenticated: True 
    Authentication Type: Forms 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
 
Thread information: 
    Thread ID: 88 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36
 
 
---------------------------------------------------------
 
Application information: 
    Application domain: /LM/W3SVC/8/ROOT-21-129646936342560999 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\Websites\OLG\onlineleadsgroup.nl\wwwroot\ 
    Machine name: ZRWN002 
 
Process information: 
    Process ID: 5184 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 
 
Exception information: 
    Exception type: TransactionAbortedException 
    Exception message: The transaction has aborted.
   at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36

Transaction Timeout

 
 
Request information: 
    Request URL: http://onlineleadsgroup.nl/Users/Account/LogOff 
    Request path: /Users/Account/LogOff 
    User host address: 193.173.23.201 
    User: admin 
    Is authenticated: True 
    Authentication Type: Forms 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
 
Thread information: 
    Thread ID: 88 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36
 

----------------------------------------------------------------
Application information: 
    Application domain: /LM/W3SVC/8/ROOT-19-129646600721444338 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\Websites\OLG\onlineleadsgroup.nl\wwwroot\ 
    Machine name: ZRWN002 
 
Process information: 
    Process ID: 5184 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\NETWORK SERVICE 
 
Exception information: 
    Exception type: TransactionAbortedException 
    Exception message: The transaction has aborted.
   at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36

Transaction Timeout

 
 
Request information: 
    Request URL: http://onlineleadsgroup.nl/ 
    Request path: / 
    User host address: 82.168.164.219 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
 
Thread information: 
    Thread ID: 13 
    Thread account name: NT AUTHORITY\NETWORK SERVICE 
    Is impersonating: False 
    Stack trace:    at System.Transactions.TransactionStatePromotedAborted.CreateAbortingClone(InternalTransaction tx)
   at System.Transactions.DependentTransaction..ctor(IsolationLevel isoLevel, InternalTransaction internalTransaction, Boolean blocking)
   at System.Transactions.Transaction.DependentClone(DependentCloneOption cloneOption)
   at System.Transactions.TransactionScope.SetCurrent(Transaction newCurrent)
   at System.Transactions.TransactionScope.PushScope()
   at System.Transactions.TransactionScope..ctor(TransactionScopeOption scopeOption, TransactionOptions transactionOptions)
   at Orchard.Data.TransactionManager.Orchard.Data.ITransactionManager.Demand() in d:\Builds\OrchardFull\src\Orchard\Data\TransactionManager.cs:line 26
   at Orchard.Data.SessionLocator.For(Type entityType) in d:\Builds\OrchardFull\src\Orchard\Data\SessionLocator.cs:line 31
   at Orchard.Data.Migration.Interpreters.DefaultDataMigrationInterpreter..ctor(ShellSettings shellSettings, ISessionLocator sessionLocator, IEnumerable`1 commandInterpreters, ISessionFactoryHolder sessionFactoryHolder, IReportsCoordinator reportsCoordinator) in d:\Builds\OrchardFull\src\Orchard\Data\Migration\Interpreters\DefaultDataMigrationInterpreter.cs:line 36
 

Nov 2, 2011 at 12:36 PM

It could be related to deadlocking issues as others have experienced: http://orchard.codeplex.com/discussions/267659 - note there's a possible workaround on Chris's blog that's linked to there.

Can you check your error and debug logs for any further information?

Of course it could be another problem caused by a third party module doing something strange. Some of my own code has occasionally started throwing up intermittent errors like this, sometimes pushing database objects down into templates can cause attempted database activity outside of the TransactionScope, resulting in all kinds of bizarre errors...

Developer
Nov 2, 2011 at 1:17 PM

I checked the log files under App_Data/Logs, and there are no entries at all on the day that the TransactionAbortedException occured. The day before I do have a lot of exceptions, but these had to do with installing the CulturePicker while Orchard.Localization was not installed, so that's probably not at all relevant.

I think you are right that it is either a deadlocking issue or a problem caused by one of the modules. I will first try the workaround as linked on Chris's blog post. If that doesn't help, I will have no choice but to dhutdown all third party modules to isolate the one that is causing the problem.
However, since the error cannot be reproduced on demand, that will be a time consuming effort.

Thanks for sharing your thoughts.