I have a web application with 8 site collections, each with their own database. I'm getting a strange error when trying to open 3 of them, but only when trying to go directly to them in a new browser window. (Meaning, if I log into one of the other sites and link back to one of the 3, there is no problem.)

I get the old "An unexpected error has occurred" window even before the login prompt appears. If I click "Go back to site", the login prompt appears and I can log in normally.

Looking through the logs, this is what's happening for each of the sites:

A few category General, level Verbose entries about looking up the site, ending with Found typical site /the/site in web application ...etc.

A General/Verbose entry Application error when access /the/site/default.aspx, Error=Operation is not valid due to the current state of the object.

A Runtime/Unexpected entry:

System.InvalidOperationException: Operation is not valid due to the current state of the object.   
 at Microsoft.SharePoint.WebControls.SPControl.EnsureSPWebRequest(SPWeb web)    
 at Microsoft.SharePoint.WebControls.SPControl.SPWebEnsureSPControl(HttpContext context)    
 at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.GetContextWeb(HttpContext context)    
 at Microsoft.SharePoint.ApplicationRuntime.SPRequestModule.PostResolveRequestCacheHandler(Object oSender, EventArgs ea)    
 at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()    
 at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

A General/Verbose entry PermissionMask check failed. asking for 0x00010000, have 0x00000000

A General/Medium entry Unknown SPRequest error occurred. More information: 0x80070005

And then releasing the SPRequest.

Because of the PermissionMask entry, I would think to look for something about permissions, but remember this is happening before I even have a chance to enter credentials.

What else can go wrong at that early stage? My gut feeling is that without having authenticated, it's not trying to serve up any content yet. The log entries mentioned looking up the site in the Config database, and I checked the database upgrade status. There were a few non-content databases that needed to be upgraded, so I ran PSConfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures, and now everything looks fine there, but the problem is still happening.

I just don't know where else to look, or even what to look for. Anyone have any ideas about this?


This apparently has to do with how SharePoint deals with different requests. Contrary to what I thought, it is not happening just on 3 sites, it's happening on all sites, and it happens when the request specifies a page.

http://server/my/site/default.aspx will produce the error.

http://server/my/site will not.

At first I thought it might be because we have a warning dialog that pops up initially, and the dialog is getting it's text from a list. Which would explain the PermissionMask error -- before authenticating, the request is anonymous (0x00000000), but meanwhile to get the text for the dialog, the code opens the web (0x00010000) where the list is. But I changed it to impersonate the system account in order to open the web and get the text (verified that this is working correctly through logging), and the error is still happening.

  • Is there any custom code on this farm? (Farm solutions) May 23, 2014 at 17:01
  • Oh yes, quite a bit, ranging from timer jobs to WCF services to event receivers to custom fields, custom form templates... an http handler for file uploads... it's pretty tricked out. May 23, 2014 at 17:11
  • I would probably start by looking through the code of the solutions deployed to those site collections. I imagine that something is being loaded that requires the security information that doesn't exist yet. Might also turn verbose logging on for everything to see if something pops up (depending on the type of customization, this may not result in anything unless the custom solutions write to the logs). May 23, 2014 at 17:16

1 Answer 1


Apparently this was a VM issue, and not a SharePoint problem after all. This morning, the VM hosting this SharePoint server appeared to be down. The virtual environment admins did some behind-the-scenes voodoo, brought the server back online, and now the error is not happening anymore. Don't really know what was wrong, or what they did to fix it, but things are back to normal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.