MSDTC: No Transaction Is Active

Lately, I’ve been fighting with MSDTC (the Microsoft Distributed Transaction Coordinator).  I have a process which runs a number of scripts (index defragmentation, DBCC checks, error log reads, etc.) for a number of servers and stores information on the host server so I can analyze the data in one place later.  This was working just fine until we virtualized the host server.  At that point, I started getting errors like the following:

MSDTC:  OLE DB provider “SQLNCLI” for linked server “analytics” returned message “No transaction is active.”
Msg 7391, Level 16, State 2, Line 2 The operation could not be performed because OLE DB provider “SQLNCLI” for linked server “[ServerName]” was unable to begin a distributed transaction.

I looked and found some good resources for solving this problem (including one which is almost all-encompassing), but all to no avail.  I figured that it couldn’t be a configuration problem because some of the servers could do distributed transactions, but others couldn’t, and there weren’t any configuration differences between the two.  Eventually, as I was messing around with a number of options on the host and called servers, I checked out the event log on the called server and noticed a message in the Application log:

The local MS DTC detected that the MS DTC on POLARIS has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running ‘msdtc -uninstall’ and then ‘msdtc -install’ from the command prompt will fix the problem. Note: Running ‘msdtc -uninstall’ will result in the system losing all MS DTC configuration information.

What happened in our case was that the servers were spun up from the same VMware template, so MS DTC had a conflict.  Solving this was pretty easy.  Run the following commands in the command prompt (as an Administrator!) for either the caller or the called server (or both):

net stop msdtc
msdtc -uninstall
msdtc -install

Then restart the server—not just the MSDTC service—and you’re good to go.

Advertisements

4 thoughts on “MSDTC: No Transaction Is Active

  1. Jessica says:

    Thanks Kevin. I have struggled with MSDTC issue for several days. Your solution is quite useful for me. Now I am back to the normal testing. I appreciated your sharing. Cheers.

  2. Dear Kevin Feasel,

    Thanks for this blog can you please let me know how can i identify that MSDTC has installed successfully, i did follow your instruction but now getting error

    Msg 8501, Level 16, State 3, Line 2
    MSDTC on server ‘DBSERVERNEW’ is unavailable.

    And as i am working on 3 Servers and on Server A i have created linked server of Server B & Server C into Server A. And from Server A i am updating table of Server C and Server B.

    Regards,
    Sunil Kumar kaushal

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s