0

We are seeing very strange intermittent error in our logs with the NServiceBus code stack trace

NServiceBus version that we are using is 3.3.4

Here the stack trace of the error:

System.ArgumentException: An item with the same key has already been added.
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at NServiceBus.MessageHeaders.MessageHeaderManager.NServiceBus.MessageMutator.IMutateOutgoingTransportMessages.MutateOutgoing(Object[] messages, TransportMessage transportMessage)
   at NServiceBus.Unicast.UnicastBus.InvokeOutgoingTransportMessagesMutators(Object[] messages, TransportMessage result)
   at NServiceBus.Unicast.UnicastBus.MapTransportMessageFor(Object[] rawMessages, TransportMessage result)
   at NServiceBus.Unicast.UnicastBus.SendMessage(List`1 addresses, String correlationId, MessageIntentEnum messageIntent, Object[] messages)
   at NServiceBus.Unicast.UnicastBus.SendMessage(Address address, String correlationId, MessageIntentEnum messageIntent, Object[] messages)
   at NServiceBus.Unicast.UnicastBus.NServiceBus.IBus.Send(Object[] messages)

Any ideas what is the issue ? Our production code from time to time fails because of this and we need to know why.

Thanks. Any help would be appreciated.

  • Could it be an issue with duplicate subscriptions? – Sean Farmar Aug 02 '14 at 09:15
  • I think it's related to this one https://github.com/Particular/NServiceBus/issues/1976 even though that issue mentions v4. Are you doing those sends from a message handler or from a MVC controller or similar? – Andreas Öhlund Aug 02 '14 at 10:14
  • We are doing sends from both MVC controllers and handlers. I think that the error most probably is triggered when sending from controllers. Need to look through the logs to see if it is thrown from the handlers as well. – Eugen Gorgan Aug 06 '14 at 13:46
  • Just an update on this i could not find any errors while sending from handlers. Any ideas what can be the issue ? – Eugen Gorgan Aug 08 '14 at 14:06
  • Confirmed. This is happening when sending messages in MVC controllers. Any ideas why ? – Eugen Gorgan Aug 14 '14 at 01:39

0 Answers0