SharePoint - IIS/SharePoint 2010 not playing friendly

Asked By Andy on 30-Jul-10 10:43 AM
Not sure if this belongs in SharePoint or IIS, but here's the deal...

I had some problems with the SharePoint 2010 and re-ran the SharePoint Products Config tool... Oops.

In any case, I detached from the farm (I'm running it all on one machine, by the way), finally re-attached and ran the config tool. At first, I had the problem of no access to the Central Admin, but had access to the Web App. Not having learned my mistake the first time, I re-ran the config tool and now have the opposite problem - access to Central Admin without the Web App. When I try to access the web app, I get a 500 error with the following stack trace saying "The farm is unavailable."

01.[InvalidOperationException: The farm is unavailable.]
02.   Microsoft.SharePoint.Administration.Claims.SPSecurityTokenServiceManager.get_Local() +24119900
03.   Microsoft.SharePoint.IdentityModel.SPTokenCache..ctor() +34
04. 
05.[TargetInvocationException: Exception has been thrown by the target of an invocation.]
06.   System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0
07.   System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +146
08.   System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +298
09.   System.Activator.CreateInstance(Type type, Boolean nonPublic) +79
10.   System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +10364331
11.   System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture) +28
12.   Microsoft.IdentityModel.Configuration.CustomTypeElement.Resolve(CustomTypeElement customTypeElement, Object[] arguments) +908
13. 
14.[ConfigurationErrorsException: ID0012: Failed to create an instance of 'Microsoft.SharePoint.IdentityModel.SPTokenCache, Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' from configuration.]
15.   Microsoft.IdentityModel.Configuration.CustomTypeElement.Resolve(CustomTypeElement customTypeElement, Object[] arguments) +1370069
16.   Microsoft.IdentityModel.Configuration.ServiceConfiguration.LoadHandlers(ServiceElement serviceElement) +1160
17.   Microsoft.IdentityModel.Configuration.ServiceConfiguration.LoadConfiguration(ServiceElement element) +843
18.   Microsoft.IdentityModel.Configuration.ServiceConfiguration..ctor() +317
19.   Microsoft.IdentityModel.Web.FederatedAuthentication.get_ServiceConfiguration() +120
20.   Microsoft.IdentityModel.Web.HttpModuleBase.Init(HttpApplication context) +17
21.   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +480
22.   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +336
23.   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +350
24.   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +382
25. 
26.[HttpException (0x80004005): ID0012: Failed to create an instance of 'Microsoft.SharePoint.IdentityModel.SPTokenCache, Microsoft.SharePoint.IdentityModel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' from configuration.]
27.   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11297830
28.   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +88
29.   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4336948

Anybody have any clues on where to begin?
iHelper MS replied to Andy on 31-Jul-10 04:12 AM
Hi Andy,

What kind of Security Accounts are you using to Setup your Farm?  Please explain your Farm setup further. 

Here is a good reference on setting up a farm with least privileged accounts:

http://sharepointgeorge.com/2010/installing-sharepoint-2010-privilege-service-accounts/

Thanks,
iHelper

Andy replied to iHelper MS on 02-Aug-10 03:40 AM
Hmm, I thought I replied already but it isn't showing up.

In any case, I used the same settings and verified everything is set up the same as the link you set me (it was already set up that way, it seems).

However, I've noticed something - when trying to access a different web app on the same machine on a different port (SERVER:80), everything seems to work. When using the local machine to access the one I want (https://intranet.SERVER.com:444) I am asked to enter my password, and it doesn't validate it (regardless of whether it is DOMAIN\User or just User), then proceeds after 3 tries to a blank page. On a remote machine, when accessing https://intranet.SERVER.com:444, I enter the User credentials and it takes me straight to the 500 Internal Server Error page...

Does that help at all?


[EDIT] I also discovered in MMC Services that the Security Token Service is not even listed... However, in the Sharepoint Management Shell, it says the service is online, and I followed the steps to provision it... Still no luck.


[SOLUTION!!!] Fixed the problem, or at least the symptom (but not necessarily the cause).

IIS keeps resetting the SharePoint Web Services to disable Windows Authentication, while enabling ASP.net and Anonymous. I went through each subsite in the SharePoint Web Services section of IIS and enabled Windows Authentication for each, and now it works again...

If anybody can think what would be causing the IIS to disable Windows Authentication, let me know!

iHelper MS replied to Andy on 03-Aug-10 02:46 PM
Thats great Andy.  Good to see a solution.  I forgot to check on your Operating System? What is your OS?