User cannot be found SharePoint 2010

I had an issue today when trying to get to the Library settings of a SharePoint 2010 document library.

User cannot be found

I checked out the corrilation ID and got the following


Unexpected       Microsoft.SharePoint.SPException: User cannot be found.    at Microsoft.SharePoint.SPUserCollection.get_Item(String loginName)     at Microsoft.SharePoint.Workflow.SPWorkflowNoCodeSupport.LoadWorkflowBytesElevated(SPFile file, Int32 fileVer, Int32& userid, DateTime& lastModified)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.AddDeclSiteTemplates(SPWeb web, String visibility, SPWorkflowTemplateCollection wftemplates, SPListTemplateType templateType)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.<>c__DisplayClass4.<RegisterNoCodeTemplates>b__0()     at Microsoft.SharePoint.SPSecurity.<>c__DisplayClass4.<RunWithElevatedPrivileges>b__2()     at Microsoft.SharePoint.Utilities.SecurityContext.RunAsProcess(CodeToRunElevated secureCode)     at Microsoft.SharePoint.SPSecurity.RunW...   1cb4ed13-c851-4083-9b20-1b2502ebaa0b

06/18/2012 15:21:17.22* w3wp.exe (0x1BD0)                                0x14C0  SharePoint Foundation               Runtime                                   tkau      Unexpected       ...ithElevatedPrivileges(WaitCallback secureCode, Object param)     at Microsoft.SharePoint.SPSecurity.RunWithElevatedPrivileges(CodeToRunElevated secureCode)     at Microsoft.SharePoint.Workflow.SPWorkflowManager.RegisterNoCodeTemplates(SPWorkflowTemplateCollection wftemplates, SPWeb web)     at Microsoft.SharePoint.SPWeb.get_WorkflowTemplates()     at Microsoft.SharePoint.ApplicationPages.ListEditPage.SetSectionLinks()     at Microsoft.SharePoint.ApplicationPages.ListEditPage.OnLoad(EventArgs e)     at ASP._layouts_listedit_aspx.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)     1cb4ed13-c851-4083-9b20-1b2502ebaa0b

Somewhere in there it mentions Workflow a number of times.  So I had a look at the workflows on the site, and noticed that the workflow was created by a user on an alternative Domain that SharePoint no longer has access to due to a domain migration.

Solution

Save and publish the workflow with a the current user that has access to the site via SharePoint designer.

Post to Twitter

Leave a Reply