Category nameļ¼šMigration

Error when publishing a message from a convoy in BizTalk Server 2013

Today I was migrating another interface from BizTalk Server 2009 to BizTalk Server2013. This interface included a sequential convoy with a filter on the activating receive shape. Multiple MessageTypes can be processed and all shapes and ports use the XmlDocument type to communicate with the MessageBox. When publishing a output message from within the loop, the message has the same context property with the same value as the filter in the activating receive shape of the orchestration. Because the activating receive shape starts a correlation, the subscription also includes a few “exists” checks, beside the mentioned filter. This is why the outgoing message is not picked up by the same orchestration again – the published message does not have the other context properties in the subscription of the activating receive shape.

All this works as expected in BizTalk Server 2009, but in BizTalk Server 2013 an error occurs when publishing the message to the MessageBox. The orchestration is suspended with the following error message (no routing failure occurs):

Uncaught exception (see the ‘inner exception’ below) has suspended an instance of service ‘ConvoyPublishingErrorTest.ConvoyOrch(70c08f5c-8d53-9a89-87f3-5dd970d8daba)’.
The service instance will remain suspended until administratively resumed or terminated.
If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
InstanceId: 26d22144-3130-4a5e-8da8-76356c646326
Shape name: Send_OutgoingConvoy
ShapeId: 2c8a68fb-8bcc-4551-b87b-836e8151fbf7
Exception thrown from: segment 2, progress 4
Inner exception: Exception occurred when persisting state to the database.

Exception type: PersistenceException
Source: Microsoft.XLANGs.BizTalk.Engine
Target Site: Void Commit()
The following is a stack trace that identifies the location where the exception occurred…..

In the Eventviewer, the following error by the source ‘BizTalk Server’ is shown:

The following stored procedure call failed: ” { call [dbo].[bts_AddConvoySetInstance]( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}”. SQL Server returned error string: “The statement has been terminated.;Cannot insert the value NULL into column ‘vtProp1’, table ‘BizTalkMsgBoxDb.dbo.ConvoySetInstances’; column does not allow nulls. INSERT fails.”.

Apparently something is changed in the handling of convoys, causing our solution to fail. To demonstrate this behavior I have created a little demo solution you can download below. Deploy this solution on your BizTalk Server 2013 environment, import the bindings, create the filedrops, start the application and use the provided Input.xml message to see what goes wrong (copy/paste the input message, since the receive location monitors “* – Copy.xml”). All the expression shapes in the orchestration are trace outputs, so you can use DebugView to monitor the orchestation.

We will open another call with Microsoft for this problem. As soon as we hear something, I will update this blogpost.

Download demo solution.

Update 21-01-2014: After some research by Microsoft, a workaround is found for this issue. This workaround includes setting an extra != filter on the activating receive shape.

To fix the issue in the demo solution, I have added a third ContextProperty to the PropertySchema. I promoted a random field from the InputSchema into this property and set the filter on the activating receive shape to <newContextProperty> != “ValueItWillNeverHave”. As long as the incoming message does not have “ValueItWillNeverHave” as a value for the promoted field, the orchestration will pick up the received message. On the message that will be sent out, I add the ContextProperty in the MessageAssignment with the value “ValueItWillNeverHave”. With this explicit filter (as apposed to the implicted filter we had before), the exception no longer appears and the convoy keeps running as expected.

However, we feel this is basic BizTalk Server functionality that should work as it did in previous versions of BizTalk Server. Therefore we have asked Microsoft to further investigate this issue and solve it at the core. This has to be done by the Product Team and might take several months before we hear more about this. I will update this post if we receive more information. We have also asked Microsoft to add this issue to the known issue list of BizTalk Server 2013, so it is documented for other users.

Incorrect validation error message when using the default XMLReceive pipeline in BizTalk 2013

At my
current project we are migrating from BizTalk Server 2009 to BizTalk Server
2013. We had a few interfaces using the default XMLReceive pipeline for the validation
of incoming messages. These interfaces had BizUnit tests, that would check the
Error Message in the Error Portal. After the migration, these tests failed,
because the Error Message was different. We found that the error was not what
we expected and was incorrect.

Below an
example to show the behavior we found:

A simple
schema had been defined, with three string elements: FieldA, FieldB and FieldC.
FieldB has a maximum length of 5 characters.

This schema
has been deployed to BizTalk and a FILE receive location is created. This
location uses the default XMLReceive pipeline with validation enabled and the
fully qualified name of the schema set at the DocumentSpecNames.

following message will be used to test the validation. FieldB had been filled
with a value of eight characters (which is three too many).

We would expect BizTalk to give the following
error message:

There was a
failure executing the receive pipeline: “Microsoft.BizTalk.DefaultPipelines.XMLReceive,
Microsoft.BizTalk.DefaultPipelines, Version=, Culture=neutral,
PublicKeyToken=31bf3856ad364e35” Source: “Pipeline Receive Port:
“ValidationReceiveError” URI:
“C:FiledropValidationReceiveErrorIN* – Copy.xml” Reason: The XML
Validator failed to validate.
Reason: The document failed to validate because of the following error:”The ‘FieldB’ element has an invalid value according to its data type.” .

Instead, we
receive the following error message:

There was a
failure executing the receive pipeline:
Microsoft.BizTalk.DefaultPipelines, Version=, Culture=neutral,
PublicKeyToken=31bf3856ad364e35” Source: “Pipeline ” Receive Port:
“ValidationReceiveError” URI:
“C:FiledropValidationReceiveErrorIN* – Copy.xml
Reason: The document failed to validate because of the following
error:”The element ‘FieldB’ cannot contain child element ‘FieldC’ because
the parent element’s content model is text only.” .

behavior has been found on different BizTalk machines, with and without CU2
installed. We have also tried different types of validation errors and all of
them give a different error message than the actual error in the XML.

Has anyone
found this behavior as well? If we create a custom pipeline with a XML dissassembler
and a XML validator component, we receive the error we expect. We will open a
call with Microsoft and I will update this post if we receive or find a