Enable BizTalk Tracking–The message was not found in the Message Box or the Tracking database

Posted by

A very common problem when using the BizTalk Administration Console Group Hub Query Tool is the following error message:

The message was not found in the Message Box or the Tracking databases. This may be caused by one of the following conditions: (1) message tracking is not enabled; (2) the message(s) is no longer referenced by a running or suspended service instance; (3) the Message Box tracking tables have been automatically purged; or (4) the SQL Server agent is not running on the Message Box servers. (Microsoft.BizTalk.Administration.SnapIn)

ErrorMessage

Let’s have a closer look at what is says why message tracking does not work:

  1. 1. message tracking is not enabled
  2. 2. the message is no longer referenced by a running or suspended instance
  3. 3. the message Box tracking tables have been automatically purged
  4. 4. the SQL Server agent is not running on the message box servers

I am going to examine each of the errors and show how to resolve it:

1. message tracking is not enabled

Message tracking needs to be enabled if you want to see history data. Tracking data stands for messages that have been completely processed. You need to enable message tracking in two places:

1. Enable message tracking on group level

In BizTalk 2010 you can right click on the BizTalk group node and select “Settings”.

image

In the group tab you will find a “Enable group-level tracking” checkbox. –> Select it.

image

If you are using an earlier version of BizTalk you need to change the setting in the dbo.adm_Group table of the BizTalkMgmtDatabase. Set GlobalTrackingOption to 1 in order to enable tracking.

image

2. Enable tracking on service level

In the second step you need to enable tracking on the service (SendPort, ReceivePort, Orchestration)  that you are interested in. Click the item and select “Tracking” from the context menu.

image

You can chose whether you want to track the message context (= Properties) or the entire message body and select where exactly you want the message to be tracked (e.g. before or after processing)

 

2. the message is no longer referenced by a running or suspended instance

This error only applies if you are looking for live messages. Live messages as compared to tracked messages can only be queried while the service that processes the message (Port, Orchestration) is still executing.

If you are interested in historical (=tracking) data, you can ignore this part of the error message.

 

3. the message Box tracking tables have been automatically purged

Tracking data in BizTalk always follows these steps.

  1. 1. Data is recorded (tracked) and written to the tracking table in the Message Box DB (BizTalkMsgBoxDb) .
  2. 2. The DB Job Tracked_Messages_Copy_BizTalkMsgBoxDb moves the tracking data from the Message Box to the Tracking DB (BizTalkDTADb)
  3. 3. The tracking data is purged from the tracking db. This depends on the settings of the DTA Purge and Archive DB job. For configuration information, check: http://msdn.microsoft.com/en-us/library/aa558715.aspx

Depending on the settings of the purge job mentioned in step 3 it can happen that you reference data that has already been purged.

4. the SQL Server agent is not running on the message box servers

For the tracking data processing to work correctly you need to ensure that the DB jobs described under point 3 can be successfully executed.

Her you need to verify two things:

1. The SQL Server Agent is running

You can use SQL Server Management Studio to find out if the SQL Server Agent is running.

Agent stopped:

image

Use the context menu to start the Agent:

image

2. Make sure the TrackedMessages_Copy_BizTalkMsgBoxDb job can execute successfully.

image

You can use the start job at step command from the context menu to run the job manually and find out if it executes successfully.

 

Taking care of these 4 errors should allow you to avoid the error message and view tracking information in the BizTalk Management Console.