0
votes

When we send a message through NServiceBus containing a full exception stacktrace we get the following NHibernate exception:

    Z Error dehydrating property value for 
NServiceBus.TimeoutPersisters.NHibernate.TimeoutEntity.Headers NHibernate.PropertyValueException NHibernate.HibernateException NServiceBus.Core 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.ProcessMessage(TransportMessage m) 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.ReceiveMessage() 
at NServiceBus.Utils.TransactionWrapper.RunInTransaction(Action callback, IsolationLevel isolationLevel, TimeSpan transactionTimeout) 
at NServiceBus.Unicast.Transport.Transactional.TransactionalTransport.Process() 

It has something to do with the length of the message field, but it seems like it's an internal NServiceBus issue. We use NServiceBus v3.2.4

The message class looks like this:

public class ExceptionOccuredCommand : ICommand
    {
        public string Message { get; set; }
        public string Details { get; set; }
        public DateTime ExceptionDate { get; set; }
        public string UserName { get; set; }
        public string MachineName { get; set; }
        public string ApplicationName { get; set; }

        public string ErrorQueue { get; set; }
        //public string SourceQueue { get; set; }
        public string MessageId { get; set; }
    }

How can this be fixed?

1
Looks like a problem with one of the headers. Can you check for long values/strange characters?Andreas Öhlund
Well, it's long for sure since it may contain the exception message and stacktrace. I will check for strange characters though, I don't think we do this yet. What would be the maximum length / size for the message contents?Thomas
I don't know, perhaps nhibernate impose a length limit. I need to dig into the code to figure it outAndreas Öhlund
I've added some unit tests to test a message with over 2500 characters, this doesn't reproduce the issue. Next up will be a test with strange characters.Thomas
There seems to be a limit on 4000 characters, can you try that?Andreas Öhlund

1 Answers

1
votes

There is a hard limit on 4000 characters for the headers and you seems to be hitting that limit. I've opened up an issue for this on our issues list: https://github.com/NServiceBus/NServiceBus/issues/737