none
Emails refuse to send after a migration to Exchange 2010 RRS feed

  • General discussion

  • Hello

    I've got a batch of MPRs that call action workflows and approval workflows to send emails after various changes to person objects.

    While these worked beautifully in Exchange 2007, they have stopped working in DEV and TEST after a faintly traumatic migration to Exchange 2010, in which all the mailboxes had to be recreated.

    The workflow instances sit in the running state for an extended period (the request sits at post processing). When, eventually, the request terminates, the information is:

    EmailNotificationDataExchange caught an exception while trying to send an email.  The email was not sent.  See the trace immediately following for exception contents.

    EXCEPTION DATA\r\n\r\nMESSAGE: System.InvalidOperationException: There is an error in XML document (1, 942). ---> System.InvalidOperationException: Instance validation error: 'ErrorInternalServerError' is not a valid value for ResponseCodeType.
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIlmExchangeServiceBinding.Read229_ResponseCodeType(String s)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIlmExchangeServiceBinding.Read253_ItemInfoResponseMessageType(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIlmExchangeServiceBinding.Read268_ArrayOfResponseMessagesType(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIlmExchangeServiceBinding.Read285_CreateItemResponseType(Boolean isNullable, Boolean checkType)
       at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIlmExchangeServiceBinding.Read339_CreateItemResponse()
       at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer37.Deserialize(XmlSerializationReader reader)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       --- End of inner exception stack trace ---
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
       at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at Microsoft.ResourceManagement.WebServices.Mail.Exchange.ExchangeServiceBinding.CreateItem(CreateItemType CreateItem1)
       at Microsoft.ResourceManagement.Mail.ExchangeProxy.ExecuteCreateItem(CreateItemType request)
       at Microsoft.ResourceManagement.Mail.ExchangeServer.SendNotification(NotificationMessage message)
       at Microsoft.ResourceManagement.Mail.NotificationMessage.Send()
       at Microsoft.ResourceManagement.Workflow.Hosting.SendMailWorkItemProcessor.SendMailMessage(MessageContent messageContent)
       at Microsoft.ResourceManagement.Workflow.Hosting.SendMailWorkItemProcessor.ProcessWorkItem(WorkItem workItem)\r\n\r\n**METHOD:Void CheckEmailSent(System.Object, System.Workflow.Activities.ConditionalEventArgs)\r\n\r\n**METHOD:Boolean Evaluate(System.Workflow.ComponentModel.Activity, System.IServiceProvider)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(T, System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(T, System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(System.Workflow.ComponentModel.Activity, System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:Boolean Run(System.Workflow.ComponentModel.IWorkflowCoreRuntime)\r\n\r\n**METHOD:Void Run()\r\n\r\n\r\n\r\nINNER EXCEPTION DATA\r\n\r\n
    ------------------------------------------------------------

    I've gone through the steps suggested at http://technet.microsoft.com/en-us/library/gg607341%28v=ws.10%29.aspx, I have created a mailbox for the Fim Service account (prior to creating this mailbox, the error was:

    EXCEPTION DATA\r\n\r\nMESSAGE: WorkflowInstance 'fd109af0-ccba-4b05-8a80-8bdcf0718799' could not resolve mail message in activity 'authenticationGateActivity1'.  Mail was not sent.\r\n\r\n**METHOD:Void ResolveMail(System.Object, System.EventArgs)\r\n\r\n**METHOD:Void RaiseEvent(System.Workflow.ComponentModel.DependencyProperty, System.Object, System.EventArgs)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(T, System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:System.Workflow.ComponentModel.ActivityExecutionStatus Execute(System.Workflow.ComponentModel.Activity, System.Workflow.ComponentModel.ActivityExecutionContext)\r\n\r\n**METHOD:Boolean Run(System.Workflow.ComponentModel.IWorkflowCoreRuntime)\r\n\r\n**METHOD:Void Run()\r\n\r\n\r\n\r\nINNER EXCEPTION DATA\r\n\r\n)

    We have enabled anonymous senders, as trying to send email via Vmailer on the FIM box was failing, and that did at least allow us to send emails, and we can send emails using powershell. I've updated config file with the correct information for the mailserver, which is now on a separate server from the DC, and Exchange 2007 is still apparently active on the DC.

    Other errors from the FIM Log:

    Microsoft.ResourceManagement.Service: System.InvalidOperationException: An error occurred trying to send your message
       at Microsoft.ResourceManagement.Mail.ExchangeServer.SendNotification(NotificationMessage message)
       at Microsoft.ResourceManagement.Mail.NotificationMessage.Send()
       at Microsoft.ResourceManagement.Workflow.Hosting.SendMailWorkItemProcessor.SendMailMessage(MessageContent messageContent)
       at Microsoft.ResourceManagement.Workflow.Hosting.SendMailWorkItemProcessor.ProcessWorkItem(WorkItem workItem)

    and

    System.ArgumentException: Cannot deference non-instantiated attribute Manager

    Microsoft.ResourceManagement: System.ArgumentException: Cannot deference non-instantiated attribute Manager
       at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveAttribute(Match m, Boolean isFunctoidArg, String& attributeName)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorWithoutAntiXSS(Match m)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveEvaluatorForBodyWithAntiXSS(Match m)
       at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
       at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator)
       at Microsoft.ResourceManagement.WFActivities.Resolver.ResolveBody(String input)
       at Microsoft.ResourceManagement.Workflow.Hosting.EmailNotificationServiceImpl.ResolveMailMessage(Guid requestId, Guid targetId, Guid actorId, Dictionary`2 workflowDictionary, String toLine, Guid emailTemplateIdentifier, EmailResolutionOptions options, String& failedToResolvePrincipals)
       at Microsoft.ResourceManagement.Workflow.Activities.EmailNotificationActivity.ResolveMail(Object sender, EventArgs e)

    WorkflowInstance '8aea054c-6919-4460-8fa7-73b35f8a9e1b' could not resolve mail message in activity 'authenticationGateActivity1.sendApprovalEmail'.  Mail was not sent.

    (although I think this last is the approval workflow that is supposed to go to a manager but which has a total spasm if there's no manager recorded for the individual)

    I've also had:

    System.InvalidOperationException: Operation is not valid due to the current state of the object.

    Microsoft.ResourceManagement: System.InvalidOperationException: Operation is not valid due to the current state of the object.
       at Microsoft.ResourceManagement.Utilities.ExceptionManager.ThrowException(Exception exception)
       at Microsoft.ResourceManagement.WebServices.Mail.Exchange.MailChannel.ExchangeMailChannelListener`1.ExchangeMailListener.EndListen(IAsyncResult asynchronousResult)
       at Microsoft.ResourceManagement.WebServices.Mail.Exchange.MailChannel.ExchangeMailChannelListener`1.OnEndAcceptChannel(IAsyncResult result)

    Although this appears to have gone now that the Fim Service Account actually has a mailbox.

    I'm bemused: where should I go delving around next to try and fix this?

    Thanks

    Jane

    Tuesday, February 5, 2013 9:42 AM

All replies

  • Hurrah! We have managed to fix this.

    The fix was to applyUpdate Rollup 5 Version 2 for Exchange 2010 SP2 to the Exchange Server.

    We turned on verbose logging, got some more information, and discovered that the problem was that we couldn't access a mailbox using an EWS application. Further errors were exactly as here.

    The update took hours to apply, but, after a reboot, the server processed the queued mails.

    I'm putting this in here, just in case someone else has similar issues - because it's taken us 3 days to get to the bottom of this, and it's not been much fun at all, as it's put our testing back by about a week.


    Wednesday, February 6, 2013 10:22 AM