Saturday, March 23, 2013

MSDTC error after cloning a virtual machine

A common development task is to clone virtual servers for different development scenarios. I myself have a bunch of virtual servers configured that I clone in order to get new fresh installs to lab with. However, when cloning machines in a BizTalk setup, you have to be aware of the issues that can develop due to the need for unique identification keys in MSDTC. When cloning a server to two instances and using one for SQL Server and the other as the BizTalk application server, MSDTC will not work. When running DTCTester the following error will appear:

Error: SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]Invalid cursor state
 The reason in this case is that the CID GUID is not unique on the servers.

Run regedit and browse to HKEY_CLASSES_ROOT\CID\ and find the GUID where Description is set to MSDTC (it is one of the four). The GUID should be exactly the same on the other server.


In order to fix this, you have to uninstall and then install MSDTC again (or you could go the wild path and just set another GUID). Uninstalling/installing MSDTC is done via the command prompt.

Open a command prompt as administrator and run the command
msdtc -uninstall
followed by
msdtc -install
Verify that the DTC coordinator has started up and check the CID values in the registry. When running MSDTCTester again it should show a successful result:

This error will be caught by the BizTalk MessageBox Viewer. It will show an error of
is duplicated on servers and - Check if < server1> and are not cluster nodes as CID must be unique on non-clustered servers!