Diagnosing a Common Transactional Queue Error

Since a lot of people seemed to like the article on interpreting error messages when opening a queue, here is a bit of discussion on interpreting error messages when reading from a queue.

As with opening a queue, MSMQ reports many common errors using generic error messages when reading from a queue. For example, reading from a queue might give you an error message that looks like this.

An error occurred while receiving a message from the queue: The transaction specified cannot be imported. (-1072824242, 0xc00e004e). Ensure that MSMQ is installed and running. Make sure the queue is available to receive from.

You have to use the specific error code to figure out more. Following the generic instructions probably isn't going to help you solve the problem as quickly. Here are some suggestions for common transactional receive problems.

In this example, the error code is MQ_ERROR_TRANSACTION_IMPORT (0xC00E004E), which typically means that the transaction coordinator is not available. MSDTC might not be running or might be blocked by your security or firewall settings.

If the error code had been MQ_ERROR_TRANSACTION_USAGE (0xC00E0050), then the problem is probably a configuration error between the queue and your program. There may be a mismatch about whether the queue is transacted or non-transacted or whether you're reading from a local or remote queue.

If the error code had been MQ_ERROR_TRANSACTION_ENLIST (0xC00E0058), then the problem typically is with creating or obtaining a resource needed to participate in the transaction. This may be caused by a lack of resources or due to a programming error in the code using the transaction (as opposed to a programming error in the application like the previous one).

Next time: PDC 2008: What to Look For