I have a windows automation that works perfectly fine on my dev environment physical machine, but intermittently faults on my test env server.
The same flow in Legacy does not ever error, irrespective of environment/machine.
The intermittent error is for any Exchange Mail activity: “The target principal name is incorrect”
Exchange mail config is:
Using EmailAutodiscover
Auth Type: UsernameAndPassword
accessing a shared mailbox
I have tried configuring the activities to point to different mailboxes and use different accounts credentials, the issue remains intermittent.
I have deleted the “.nuget\packages” folder to no avail.
Again, this issue is intermittent - it will work with the exact same config sometimes but not others with no change to the code.
full error text:
The target principal name is incorrect.
UiPath.Mail.ExchangeException: The target principal name is incorrect. at UiPath.Mail.Exchange.EwsClient.ExchangeServiceFactory.CreateConnectionWithLocalAuthenticationAsync(ExchangeConnection exchangeConnection)
at UiPath.Mail.Exchange.EwsClient.ExchangeServiceFactory.CreateConnection(ExchangeConnection exchangeConnection)
at UiPath.Mail.Exchange.Activities.GetExchangeMailMessages.<>c__DisplayClass52_0.<b__0>d.MoveNext()
— End of stack trace from previous location —
at UiPath.Mail.Exchange.Activities.ExchangeActivity`1.ExecuteAsync(AsyncCodeActivityContext context, CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at UiPath.Mail.Activities.BaseMailAsyncActivity.EndExecute(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context, IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)