Friday, July 6, 2018

SharePoint 2013 Workflow suspended for certain user - Send Email

My scenario was when a user adds an item to the list, 2013 workflow runs on that item and sends out an email to a SharePoint group.


This was functioning for most of the users who had contribute permissions to that list. However there were certain users who also had contribute permissions to the list but the workflow would go to suspended state when those user adds an item. Important thing to notice was that workflow did kick off successfully and did other steps but it went into suspended state when the action to execute in the workflow was to send an email to the SharePoint group.


After narrowing down the issue to only certain users, the next step was to see the difference between users who have contribute access that are able to send an email to the SharePoint group to the users who couldn't.


ULS logs had the following message:


HTTP Unauthorized to /_vti_bin/client.svc/sp.utilities.utility.SendEmail
RequestorId: c4f61784-766a-e0af-0000-000000000000. Details: RequestorId: c4f61784-766a-e0af-0000-000000000000. Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 401 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["96"],"SPRequestGuid":["c4f61784-766a-e0af-bd84-218299c77930"],"request-id":["c4f61784-766a-e0af-bd84-218299c77930"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4454"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Thu, 21 Feb 2013 14:15:02 GMT"],"P3P":["CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\""],"Server":["Microsoft-IIS\/7.5"],"WWW-Authenticate":["NTLM"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) in d:\bt\98787\private\source\WF\Microsoft.Activities.Hosting\Microsoft\Activities\Hosting\Runtime\Subroutine.cs:line 282 at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)


The final resolution which worked for me is from this Microsoft article.




There are a few solutions to this problem.

  1. Allow everybody to see the members of the SharePoint group.
  2. Remove the SharePoint group from the To or CC line of the email.
  3. Explicitly add the users to the To or CC line if the membership visibility cannot be changed for the SharePoint group.
2 & 3 was not meeting our requirements.


Following are the changes I made it to work.


1. Change the group setting on the SharePoint group to which the email was sent to "Allow everyone to see the membership of the group".


2. Also added the user to that SharePoint group. (All the users who had contribute access to the list and was able to run the workflow successfully was part of the SharePoint