Friday 30 November 2007

MSDTC Transaction Errors. What to check?

We've been working on a datacentre migration where we're moving several web applications over to a new virtual environment (VMware ESX Server) and everything had been running smoothly until we started to get this error a week or so ago.

Event Type: ErrorEvent
Source: AnApplication
Category: None
Event ID: 0
Date: 29/11/2007
Time: 15:39:33
User: N/A
Computer: ASERVER

Description:Message failed to import - moving to suspend queue: System.InvalidOperationException: An error occurred while enlisting in a distributed transaction.
Server stack trace: at System.Data.SqlClient.SqlInternalConnection.EnlistNonNullDistributedTransaction(ITransaction transaction) at System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction(ITransaction newTransaction, Guid newTransactionGuid) at System.Data.SqlClient.SqlInternalConnection.EnlistDistributedTransaction() at System.Data.SqlClient.SqlInternalConnection.Activate(Boolean isInTransaction) at System.Data.SqlClient.SqlConnection.Open()


Trawling Google shows a number of possibilities for this, most usually around incorrectly configured firewalls, DTC settings or connection strings however nothing had changed in our environment to prompt these errors.

After trying Microsoft DTCPing and verifying everything was working as expected we moved on to the DTCTester. DTCTester was failing with errors which we found a little bizarre as the DTCPing tools that tests connectivity was passing with flying colours.

The one thing that hadn't been on the check list on any if the support sites (that we'd found anyway) was the amount of machine resources required to support distributed transactions.

We hadn't changed any of the resource allocations to any of the servers since setting them up, the web servers had 2 vCpus + 2gB of RAM and the SQL 4 vCpus + 4gB RAM and they had been allocated fixed minimums in the VMware Virtual Infrastructure Client resource pools. Adding additional VMs into the mix had squeezed something in the ESX Server and started to cause us problems somewhere down the line. After shutting down a few VMs miraculously we were getting distributed transactions working again.

Anyway, if you've tried everything else and you're still having problems with you DTC failing make sure you've got plenty of welly behind your servers and you might just get rid of that pesky "An error occurred while enlisting in a distributed transaction" message.