Failed to deserialize the envelope of the incoming message

Hi there,
We are creating a new send only endpoint with NSB 7.2 using Azure Storage + NewtonsoftSerializer. We have other endpoints that are currently running NSB 5.2.25 with default JsonSerializer.
While we’d eventually want to upgrade all of our endpoints, we still have some ways to go :frowning:

When sending a command from 7.2 to 5.2.25 we are getting following error. Is it even possible to do this?

2019-11-09 13:08:38.178 ERROR NServiceBus.Azure.Transports.WindowsAzureStorageQueues.PollingDequeueStrategy Failed to deserialize the envelope of the incoming message. Message will be discarded. MessageId: e656143b-26ac-47cb-b0c8-079e16d68204
NServiceBus.Azure.Transports.WindowsAzureStorageQueues.EnvelopeDeserializationFailed: Failed to deserialize message envelope —> System.ArgumentException: Invalid destination address specified
Parameter name: destination
at NServiceBus.Address.Parse(String destination) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Address.cs:line 91
at NServiceBus.Azure.Transports.WindowsAzureStorageQueues.AzureMessageQueueReceiver.DeserializeMessage(CloudQueueMessage rawMessage) in c:\BuildAgent\work\4e5353dd260f0a07\src\Transport\AzureMessageQueueReceiver.cs:line 179
at NServiceBus.Azure.Transports.WindowsAzureStorageQueues.AzureMessageQueueReceiver.Receive() in c:\BuildAgent\work\4e5353dd260f0a07\src\Transport\AzureMessageQueueReceiver.cs:line 110
— End of inner exception stack trace —

Here’s the message body:

{“IdForCorrelation”:null,“Id”:“4664f25e-27f1-4b6f-9197-ab00013b6ffb”,“MessageIntent”:1,“ReplyToAddress”:null,“TimeToBeReceived”:“00:00:00”,“Headers”:{“NServiceBus.MessageId”:“4664f25e-27f1-4b6f-9197-ab00013b6ffb”,“NServiceBus.MessageIntent”:“Send”,“NServiceBus.ConversationId”:“2c4bf6fd-c7f1-4dc2-b653-ab00013b7032”,“NServiceBus.CorrelationId”:“4664f25e-27f1-4b6f-9197-ab00013b6ffb”,“NServiceBus.OriginatingMachine”:“Sudins”,“NServiceBus.OriginatingEndpoint”:“stageagent-cms”,"$.diagnostics.originating.hostid":“5f6a6c476648f30cf957a7540280610f”,“NServiceBus.ContentType”:“application/json”,“NServiceBus.EnclosedMessageTypes”:“StageAgent.Messages.Core.Commands.ApproveSubittedCompanyCommand, StageAgent.Messages.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null”,“NServiceBus.Version”:“7.2.0”,“NServiceBus.TimeSent”:“2019-11-09 19:08:28:763355 Z”},“Body”:“77u/eyJJZCI6ImQ4NWM2NGMyLTJlMmYtNGJkOS1iYmZmLTNkNmI0Nzc2NzFhZCIsIk9uVXRjIjoiMjAxOS0xMS0wOVQwMDowMDowMC0wODowMCJ9”,“CorrelationId”:“4664f25e-27f1-4b6f-9197-ab00013b6ffb”,“Recoverable”:true}

Hi Kebin,

I was able to send and process messages from an ASQ endpoint on NServiceBus 7.2.0 to an ASQ endpoint on NServiceBus 5.2.26.

I would advise sending your question to the support (https://particular.net/support) and siting this post for the following reasons:

  1. You might need to provide more details to assist with the troubleshooting and you might not want to share those publicly.
  2. NServiceBus version 5.2 is no longer supported and requires extended support.

The findings can be shared later on this post if you’d like to.

Hi Sean,
Thanks of getting back. I’ll try to see if 7.2 => 5.2.26 works. At the meantime does the error “Failed to deserialize the envelope of the incoming message” hint anything?

Thanks,
Kebin

This would only happen if the message in the queue got somehow corrupted.
If you could set up a simple repro and share it via GitHub, that would help to see what’s going on.

Just an update: I’ve contacted support and will post any findings on this issue.

Just to summarize the investigation result for posterity: This is a bug in v6.2.1 version of the ASQ transport. Unfortunately that version is out of mainstream support (unless you have Extended Support at the time of this writing).

This happens when a SendOnly endpoint (here a NSB v7 endpoint) sends a message to a v5 endpoint (running the said version of ASQ transport). Because the v7 endpoint is running in SendOnly mode, it won’t set the ReplyToAddress value in the header.

The workaround is to set the value on the sender side (v7 endpoint) manually using SendOptions and setting the header value manually, e.g.

var options = new SendOptions();
options.SetHeader(Headers.ReplyToAddress, endpointName);
await instance.Send(msg, options);

Hope this helps,
Hadi

1 Like

While this is a bug, there will be no fix for it as the versions of NServiceBus/ASQ transport are out of support. Please see supported versions here: NServiceBus Packages Supported Versions • NServiceBus • Particular Docs

It’s recommended up upgrade to the lowest supported version to continue receiving bug fixes.

1 Like