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?
EDIT:
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.