I have a WebPart where I'm executing a custom job. For most users it works fine but for some not, and in log I can see such an entry:
site enumeration stack at microsoft.sharepoint.administration.spsitecollection.get_item(int32 index)
Here is the implementation of Execute method:
public override void Execute(Guid targetInstanceId)
{
SPWebApplication webApp = this.Parent as SPWebApplication;
SPList myList = webApp.Sites[0].RootWeb.Lists["myList"];
...
//operations on that list, updates too
}
Under what account is that job executed? Could it be the problem that some users do not have privileges and even webApp.Sites[0] could not be evaluated?