SharePoint Workflow send email error

Emanuel Borsoi 156 Reputation points
2021-02-01T10:18:58.263+00:00

I have a Workflow 2013 on my 2016 OnPremise farm, which sends emails. Today suddenly it stopped to work and it throws the following error:

System.Net.WebException: Exception encountered while processing the HTTP request. Exception details: 'HttpClient.SendAsync task was canceled. TraceActivityId=df66ae7c-8ca8-56d0-a2f9-d58625db1b8a'.  
   at Microsoft.Workflow.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)  
   at Microsoft.Activities.Hosting.HostedHttpExtension.HttpRequestWorkItem.OnEndComplete(ScheduledWorkItemContext context, IAsyncResult result)  

However, It does send the email, the user receive it, but the workflow is in a sort of loop and sends the email each minute until the workflow is not cancelled by the user. No changes have been done to the workflow, neither updates installed.
Can't find any information on the web.

I tried to reproduce the issue, calling the endpoint using Postman. The endpoint works, I get 200, receive the email, however the call lasts 1minute and the result is:

{  
    "d": {  
        "SendEmail": null  
    }  
}  

Is this correct? If I take a look into the API, SendEmail should return true or false...

Please need help.

Edit:
I found these lines in the ULS:

User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
User-Agent is empty  
Did not find token claim in token. ClaimType: 'scope'.  
Did not find token claim in token. ClaimType: 'scp'.  
Did not find token claim in token. ClaimType: 'clientappid'.  
Did not find token claim in token. ClaimType: 'appid'.  
Did not find token claim in token. ClaimType: 'roles'.  
Token is for a windows account.  
Leaving Monitored Scope: (UserProfile.RetrieveUserFromCache) Execution Time=30.3922; CPU Milliseconds=10; SQL Query Count=10; Parent=Executing the user mapping operation in GetMappedIdentityClaim()  
Leaving Monitored Scope: (Executing the user mapping operation in GetMappedIdentityClaim()) Execution Time=45.6827; CPU Milliseconds=16; SQL Query Count=11; Parent=Inside SPIdentityClaimMapperOperations.GetClaimFromExternalMapper(); calling the registered SPIdentityClaimMapper  
Leaving Monitored Scope: (Inside SPIdentityClaimMapperOperations.GetClaimFromExternalMapper(); calling the registered SPIdentityClaimMapper) Execution Time=46.5036; CPU Milliseconds=17; SQL Query Count=11; Parent=Inside SPSecurityTokenService.GetLogonIdentityClaim; getting the identity claim from MapperOperations  
Leaving Monitored Scope: (Inside SPSecurityTokenService.GetLogonIdentityClaim; getting the identity claim from MapperOperations) Execution Time=46.528; CPU Milliseconds=17; SQL Query Count=11; Parent=SPSecurityTokenService.GetOutputClaimsIdentity()  
SPSecurityTokenServiceManager!EnsureSharePointLogonRequestClaims: InputIdentity doesn't conatin a PrimarySid claim.  
Leaving Monitored Scope: (SPSecurityTokenService.GetOutputClaimsIdentity()) Execution Time=65.478; CPU Milliseconds=26; SQL Query Count=15; Parent=SPSecurityTokenService.GetTokenLifetime()  
Leaving Monitored Scope: (SPSecurityTokenService.GetTokenLifetime()) Execution Time=65.5362; CPU Milliseconds=26; SQL Query Count=15; Parent=SPSecurityTokenService.Issue  
Leaving Monitored Scope: (SPSecurityTokenService.Issue) Execution Time=67.2027; CPU Milliseconds=27; SQL Query Count=15; Parent=ExecuteSecurityTokenServiceOperationServer  
[Forced due to logging gap, cached @ 02/02/2021 07:56:06.23, Original Level: Verbose] SPRequestSecurityToken: SerializeProperty() serializing elementname:{0}, with value:{1}.  
[Forced due to logging gap, Original Level: Verbose] Entering Monitored Scope ({0}). Parent={1}  
Token is for a windows account.  
User key and fullName are identical. FullName: 'i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint'.  
serviceHost_RequestExecuting  
EntityTypes calculated. Web: '630712b3-dee6-4d9d-8dea-fe4001b8931b', WebApp: 'null', EntityTypeCount: '6'.  
EntityTypes calculated. Web: '630712b3-dee6-4d9d-8dea-fe4001b8931b', WebApp: 'null', EntityTypeCount: '6'.  
Token is for a windows account.  
User key and fullName are identical. FullName: 'i:0i.t|00000003-0000-0ff1-ce00-000000000000|app@sharepoint'.  
SPMailMessageHelper.IsOutboundMailPortAndEnableSslEnabled: Returning true - the OutboundMailPortAndEnableSsl flight is enabled.  
SPSmtpClient.IsOutboundMailAllowOverrideEnvelopeSenderEnabled: Returning true - the OutboundMailAllowOverrideEnvelopeSender flight is enabled.  
SPSMTPClient.Send::start  
SPMailMessageHelper.CreateHeaders: X-SpMailMessageId = 80c9aee1-0240-411f-89d0-6202c41e74da  
[Forced due to logging gap, cached @ 02/02/2021 07:56:06.35, Original Level: Medium] Attempting to send mail to recipients: {0}. Mail Subject: {1}.{2}  
[Forced due to logging gap, Original Level: Medium] Succeeded in sending mail to recipients: {0}. Mail Subject: {1}.{2}  
SPSMTPClient.Send::success  
Leaving Monitored Scope: (Microsoft.SharePoint.Utilities.SPUtility.SendEmail) Execution Time=63016.6158; CPU Milliseconds=14; SQL Query Count=5; Parent=Request (POST:http://portal/_api/sp.utilities.utility.SendEmail)  
serviceHost_RequestExecuted  



  
SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
551 questions
{count} votes

0 additional answers

Sort by: Most helpful