Thursday, August 8, 2013

MBV checks for orphan instances disabled

The Message Box Viewer (MBV) checks for orphan instances were disabled in our live environment, that is they were not run. The MBV reports said:

"BizTalk - DTA Db : Orphaned Svc Instances  (SQL Query, 2 Rules, Disabled, can not be executed in a multiple MsgBox config or if MsgBox db not located on same server than DTA db)"

However, we are not having a multiple messagebox configuration and our messagebox database is located on same server as the tracking (DTA) database.

However, testing shows that the problem is caused by what seems to be a case sensitive string comparison between the messagebox database and the tracking database. If there isn't an exact match, the orphan check will not be run.

In our case we have different dns-names pointing to the messagebox database and the tracking database respectively, but the databases are on the same server/instance.

As I understand the MBV license the  LIMITATIONS ON REVERSE ENGINEERING, DECOMPILATION, AND DISASSEMBLY mean that you cannot use say .Net Reflector to find the exact cause of the problem - let alone fix it yourself :-(

Maybe this tool should be moved to Open Source?

I hope Microsoft will do a hotfix MBV (version 12 and 13) where the case sensitive string comparison is changed into a comparison along these lines:

private bool MessageBoxAndTrackingDbOnDifferentServers()
    if (String.Compare(MSGBOXDBServer, DTADBServer, StringComparison.OrdinalIgnoreCase) == 0)
        return false;

    var seperators = new[] { '\\', ':' };

    foreach (var seperator in seperators)
        var msgboxServerSplit = MSGBOXServer.Split(seperator);
        var dtaServerSplit = DTADBServer.Split(seperator);

        if (msgboxServerSplit.Length != 2 || dtaServerSplit.Length != 2) continue;

        if (String.Compare(msgboxServerSplit[1], dtaServerSplit[1], StringComparison.OrdinalIgnoreCase) != 0)
            return true;

        if (GetAddress(msgboxServerSplit[0]) != GetAddress(dtaServerSplit[0]))
            return true;
    return false;

This code allow different casing as well as different dns-names as long as they point to the same ip-address.

GetAddress is pretty much stolen from the msdn ping sample:

public static string GetAddress(string server)
    var pingSender = new Ping();
    var options = new PingOptions {DontFragment = true};

    // Use the default Ttl value which is 128, 
    // but change the fragmentation behavior.

    // Create a buffer of 32 bytes of data to be transmitted. 
    const string data = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    var buffer = Encoding.ASCII.GetBytes(data);
    const int timeout = 120;
    var reply = pingSender.Send(server, timeout, buffer, options);
    if (reply != null && reply.Status == IPStatus.Success)
        return reply.Address.ToString();

    return Guid.NewGuid().ToString();

Thursday, June 20, 2013

Could not load file or assembly 'System.Management.Automation, Version= running the BizTalk 2013 Power Shell Provider

Trying out the brand new BizTalk 2013 Power Shell Provider ( I got this error:
Add-PSSnapin : Could not load file or assembly 'System.Management.Automation, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

This happened after installing version (the updated Power Shell Provider for BizTalk Server 2013) on top of version on a Windows 2008 R2 server.
I bit of Goggling suggested that I installed the Windows Management Framework 3.0 ( which I did and now everything works again.

Thursday, June 13, 2013

Microsoft.BizTalk.ExplorerOM.PermissionException in BizTalk 2013

Testing our automatic BizTalk application installer framework today against a newly installed BizTalk 2013 group failed. I  was getting the exception:

Microsoft.BizTalk.ExplorerOM.PermissionException: Error in the application

Running the BizTalk Server Administration Console using the same (service)account as for my failing installer I got this similar error:

Failed to load Group […BizTalkMgmtDb] data providers. (Microsoft.BizTalk.Administration.SnapIn)

Connecting to ExplorerOM failed. (Microsoft.BizTalk.SnapIn.Framework)
Error in the application. (Microsoft.BizTalk.ExplorerOM)


Running SQL Profiler I found this User Error Message:

The SELECT permission was denied on the object 'bts_dynamic_sendport_handlers', database '…, schema 'dbo'.

Granting these permissions (inspired by other working installations) on the table 'bts_dynamic_sendport_handlers' fixed the problem:



GRANT SELECT, INSERT, DELETE, UPDATE ON [dbo].[bts_dynamic_sendport_handlers] TO [BTS_ADMIN_USERS]

GRANT SELECT ON [dbo].[bts_dynamic_sendport_handlers] TO [BTS_OPERATORS]

GRANT SELECT ON [dbo].[bts_dynamic_sendport_handlers] TO [BTS_HOST_USERS]

Apparently this is well known (but not easily Googled):
In my case, I had deleted all databases of a previous BizTalk 2010 installation, but still I got this problem, which in the first reference above is described as an upgrade related issue.

Tuesday, February 19, 2013

How-to link host instance name with process ID

My college (Biranchi Narayan Mohapatra) showed me this way to link Process IDs to host instance names:

You just execute the following command in the Windows cmd shell: