Commands are randomly throwing MessageDeserializationException

1,226 views
Skip to first unread message

Carl Berisford-Murray

unread,
Feb 7, 2016, 7:34:15 PM2/7/16
to Particular Software
Helpful information to include
Product name:
Version: 5.2.9
Stacktrace:
Description: Commands are randomly throwing:
 NServiceBus.MessageDeserializationException: An error occurred while attempting to extract logical messages from transport message b5513694-1a15-4ca7-8bf2-a5a60006cf64 ---> System.Exception: Could not find metadata for 'Newtonsoft.Json.Linq.JObject'.
Please ensure the following:

The odd thing is that about half of the messages are successful, but half have this error. Here are two extracts from ServiceInsight

Failed:

 {
  "ClientTimestamp": "2016-02-08T00:24:47.3462746Z",
  "Id": "44a52cf9-cc4b-4065-ab6b-c6510832efd6",
  "ResponseType": 0,
  "EventId": "00000000-0000-0000-0000-000000000000",
  "TaskId": "ce627b2f-494f-4bdb-83c1-24d5f366378c",
  "ComponentId": "678a5adf-ea23-469d-8b7b-fc3f8965a02d",
  "UserId": "24bf07b8-52cc-43dc-b3cd-5a82977449e9",
  "TrackingNumber": 4,
  "LocationStatus": 0,
  "Latitude": 0.0,
  "Longitude": 0.0,
  "Created": "2016-02-08T00:24:47.1642745Z",
  "Date1": "0001-01-01T00:00:00",
  "Date2": "0001-01-01T00:00:00",
  "Number1": 0.0,
  "Number2": 0.0,
  "Enum1": 0,
  "Guid1": "00000000-0000-0000-0000-000000000000",
  "String1": null,
  "String2": null
}

Succeeded:
 {
  "ClientTimestamp": "2016-02-08T00:24:41.2502744Z",
  "Id": "d0934b4d-00c9-41ae-8f99-1a37dfdec66c",
  "ResponseType": 0,
  "EventId": "928d5957-b713-4fd4-990a-3c7ab9023112",
  "TaskId": "361f71b1-a2b3-4b00-b1fe-dc89aedcc5e3",
  "ComponentId": "a1023fde-073b-4bd5-a8da-7f8dac2036bf",
  "UserId": "00000000-0000-0000-0000-000000000000",
  "TrackingNumber": 5,
  "LocationStatus": 1,
  "Latitude": 0.0,
  "Longitude": 0.0,
  "Created": "2016-02-08T00:24:37.8942786Z",
  "Date1": "0001-01-01T00:00:00",
  "Date2": "0001-01-01T00:00:00",
  "Number1": 0.0,
  "Number2": 0.0,
  "Enum1": 0,
  "Guid1": "ce627b2f-494f-4bdb-83c1-24d5f366378c",
  "String1": null,
  "String2": null
}

 {
  "ClientTimestamp": "2016-02-08T00:18:14.7236817Z",
  "Id": "d6f77c32-926d-4f99-a075-3f02d2f03fdb",
  "ResponseType": 0,
  "EventId": "3a80bd71-9381-49d8-8a77-b3b2c8445635",
  "TaskId": "4c95eac2-cf38-463a-a9bf-f7839cbbf07f",
  "ComponentId": "9b873164-6ec2-4551-8122-12b739f5c97b",
  "UserId": "00000000-0000-0000-0000-000000000000",
  "TrackingNumber": 6,
  "LocationStatus": 1,
  "Latitude": 0.0,
  "Longitude": 0.0,
  "Created": "2016-02-08T00:18:13.530294Z",
  "Date1": "0001-01-01T00:00:00",
  "Date2": "0001-01-01T00:00:00",
  "Number1": 0.0,
  "Number2": 0.0,
  "Enum1": 0,
  "Guid1": "00000000-0000-0000-0000-000000000000",
  "String1": null,
  "String2": null
}

Any help is much appreciated!

Carl Berisford-Murray

unread,
Feb 7, 2016, 7:51:54 PM2/7/16
to Particular Software
An update... I've removed all the properties from the commands, and now the bodies are:
 {}

And it's still showing the same behaviour. I *think* that it's set up in exactly the same way as all the other endpoints - they do share a configuration.
The command was originally using unobtrusive mode, but I've since added an explicit : ICommand to the class.
We're using Azure Service Bus as a transport.

Is there anything else that I should be checking? This has flummoxed me!

Andreas Ohlund

unread,
Feb 8, 2016, 2:41:01 AM2/8/16
to particula...@googlegroups.com
What is the exception you are getting? (should be in the headers - http://docs.particular.net/nservicebus/messaging/headers#error-forwarding-headers )

--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.
To view this discussion on the web visit https://groups.google.com/d/msgid/particularsoftware/3fedbfb0-3982-4f1c-8ea9-ece2e5d6e929%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Carl Berisford-Murray

unread,
Feb 8, 2016, 2:53:13 AM2/8/16
to Particular Software
The exception is: 
NServiceBus.ExceptionInfo.ExceptionTypeNServiceBus.MessageDeserializationException

And the stack trace is:
 NServiceBus.MessageDeserializationException: An error occurred while attempting to extract logical messages from transport message 2ee323ad-116f-4e44-ae1e-a5a6000dd0b1 ---> System.Exception: Could not find metadata for 'Newtonsoft.Json.Linq.JObject'.
Please ensure the following:
1. 'Newtonsoft.Json.Linq.JObject' is included in initial scanning. 
2. 'Newtonsoft.Json.Linq.JObject' implements either 'IMessage', 'IEvent' or 'ICommand' or alternatively, if you don't want to implement an interface, you can use 'Unobtrusive Mode'.
   at NServiceBus.Unicast.Messages.MessageMetadataRegistry.GetMessageMetadata(Type messageType) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\MessageMetadataRegistry.cs:line 37
   at NServiceBus.Unicast.Messages.LogicalMessageFactory.Create(Type messageType, Object message, Dictionary`2 headers) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\LogicalMessageFactory.cs:line 72
   at NServiceBus.DeserializeLogicalMessagesBehavior.<>c__DisplayClass17_0.<Extract>b__1(Object x) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\DeserializeLogicalMessagesBehavior.cs:line 94
   at System.Linq.Enumerable.WhereSelectArrayIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at NServiceBus.DeserializeLogicalMessagesBehavior.Extract(TransportMessage physicalMessage) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\DeserializeLogicalMessagesBehavior.cs:line 93
   at NServiceBus.DeserializeLogicalMessagesBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\DeserializeLogicalMessagesBehavior.cs:line 40
   --- End of inner exception stack trace ---
   at NServiceBus.DeserializeLogicalMessagesBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Messages\DeserializeLogicalMessagesBehavior.cs:line 44
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.ApplyIncomingTransportMessageMutatorsBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\MessageMutator\ApplyIncomingTransportMessageMutatorsBehavior.cs:line 20
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.SubscriptionReceiverBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Subscriptions\MessageDrivenSubscriptions\SubscriptionReceiverBehavior.cs:line 31
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.UnitOfWorkBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\UnitOfWork\UnitOfWorkBehavior.cs:line 32
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.ChildContainerBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Behaviors\ChildContainerBehavior.cs:line 17
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.ProcessingStatisticsBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Monitoring\ProcessingStatisticsBehavior.cs:line 23
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.<>c__DisplayClass4_0.<InvokeNext>b__0() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 94
   at NServiceBus.AuditBehavior.Invoke(IncomingContext context, Action next) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Audit\AuditBehavior.cs:line 20
   at NServiceBus.BehaviorChain`1.InvokeNext(T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 107
   at NServiceBus.BehaviorChain`1.Invoke() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\BehaviorChain.cs:line 52
   at NServiceBus.Pipeline.PipelineExecutor.Execute[T](BehaviorChain`1 pipelineAction, T context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\PipelineExecutor.cs:line 129
   at NServiceBus.Pipeline.PipelineExecutor.InvokePipeline[TContext](IEnumerable`1 behaviors, TContext context) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\PipelineExecutor.cs:line 85
   at NServiceBus.Pipeline.PipelineExecutor.InvokeReceivePhysicalMessagePipeline() in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Pipeline\PipelineExecutor.cs:line 102
   at NServiceBus.Unicast.UnicastBus.TransportMessageReceived(Object sender, TransportMessageReceivedEventArgs e) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\UnicastBus.cs:line 826
   at NServiceBus.Unicast.Transport.TransportReceiver.OnTransportMessageReceived(TransportMessage msg) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 411
   at NServiceBus.Unicast.Transport.TransportReceiver.ProcessMessage(TransportMessage message) in C:\BuildAgent\work\3206e2123f54fce4\src\NServiceBus.Core\Unicast\Transport\TransportReceiver.cs:line 328
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftware+unsub...@googlegroups.com.

To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.

Andreas Ohlund

unread,
Feb 8, 2016, 3:18:57 AM2/8/16
to particula...@googlegroups.com
What's the value of the `NServiceBus.EnclosedMessageTypes` header?

To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.

--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.

To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.

Carl Berisford-Murray

unread,
Feb 8, 2016, 3:21:42 AM2/8/16
to particula...@googlegroups.com
NServiceBus.EnclosedMessageTypesShare.Orange.Contracts.Commands.CreateNewResponseCommand, Share.Orange.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null


Carl Berisford-Murray

unread,
Feb 8, 2016, 3:22:37 AM2/8/16
to Particular Software
Also the assembly is referenced by both the sender and the endpoint

Andreas Ohlund

unread,
Feb 8, 2016, 3:28:44 AM2/8/16
to particula...@googlegroups.com
Just double checking: the header is the same on both the ok and the failing message?

--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.

Carl Berisford-Murray

unread,
Feb 8, 2016, 3:53:44 AM2/8/16
to <particularsoftware@googlegroups.com>
Yes :)

Sent from my iPhone
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/lc7shFVR46k/unsubscribe.
To unsubscribe from this group and all its topics, send an email to particularsoftw...@googlegroups.com.

To post to this group, send email to particula...@googlegroups.com.
Visit this group at https://groups.google.com/group/particularsoftware.

Carl Berisford-Murray

unread,
Feb 8, 2016, 4:07:03 AM2/8/16
to particula...@googlegroups.com

Pretty much everything is identical – which is why this is so puzzling!

andreas.ohlund

unread,
Feb 8, 2016, 4:18:33 AM2/8/16
to Particular Software
I have a hunch that it's either the conventions that making this fail.

Is it the messages that where sent with the old convention in place that fails or the new ones?

My other hunch is that the assembly info in the header causes it to fail if you have a different assembly in the receiver.

Are you able to change the message using queue explorer and retry? 

If yes change: `NServiceBus.EnclosedMessageTypesShare.Orange.Contracts.Commands.CreateNewResponseCommand, Share.Orange.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
`   to `NServiceBus.EnclosedMessageTypesShare.Orange.Contracts.Commands.CreateNewResponseCommand`


 since that would take the assembly out of the equation.

On Monday, February 8, 2016 at 10:07:03 AM UTC+1, Carl Berisford-Murray wrote:

Pretty much everything is identical – which is why this is so puzzling!

 

 

From: particularsoftware@googlegroups.com [mailto:particularsoftware@googlegroups.com] On Behalf Of Carl Berisford-Murray
Sent: 08 February 2016 08:54
To: <particularsoftware@googlegroups.com> <particularsoftware@googlegroups.com>
Subject: Re: [particularsoftware] Re: Commands are randomly throwing MessageDeserializationException

 

Yes :)

Sent from my iPhone


On 8 Feb 2016, at 8:28 am, Andreas Ohlund <andreas...@particular.net> wrote:

Just double checking: the header is the same on both the ok and the failing message?

On Mon, Feb 8, 2016 at 9:22 AM, Carl Berisford-Murray <carl....@gmail.com> wrote:

Also the assembly is referenced by both the sender and the endpoint

On Monday, 8 February 2016 08:21:42 UTC, Carl Berisford-Murray wrote:

NServiceBus.EnclosedMessageTypes

Share.Orange.Contracts.Commands.CreateNewResponseCommand, Share.Orange.Contracts, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null

 

--
You received this message because you are subscribed to the Google Groups "Particular Software" group.

To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftware+unsub...@googlegroups.com.
To post to this group, send email to particularsoftware@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/lc7shFVR46k/unsubscribe.

To unsubscribe from this group and all its topics, send an email to particularsoftware+unsub...@googlegroups.com.
To post to this group, send email to particularsoftware@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Particular Software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/particularsoftware/lc7shFVR46k/unsubscribe.

To unsubscribe from this group and all its topics, send an email to particularsoftware+unsub...@googlegroups.com.
To post to this group, send email to particularsoftware@googlegroups.com.

Carl Berisford-Murray

unread,
Feb 8, 2016, 5:32:04 AM2/8/16
to Particular Software

Apologies....
There was a rogue endpoint listening with an older version of the assembly

andreas.ohlund

unread,
Feb 8, 2016, 5:34:21 AM2/8/16
to Particular Software
No worries, we're here to help :)

Daniel Marbach

unread,
Feb 13, 2016, 6:25:29 AM2/13/16
to Particular Software
No worries! This is another indication that we need to stop using the assembly qualified name in the header, so feel free to blame us ;)...

Daniel

Andreas Ohlund

unread,
Feb 13, 2016, 6:58:46 AM2/13/16
to particula...@googlegroups.com
For future reference, here's the issue that tracks this 


On Sat, Feb 13, 2016 at 12:25 PM, Daniel Marbach <daniel....@particular.net> wrote:
No worries! This is another indication that we need to stop using the assembly qualified name in the header, so feel free to blame us ;)...

Daniel
--
You received this message because you are subscribed to the Google Groups "Particular Software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to particularsoftw...@googlegroups.com.
To post to this group, send email to particula...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages