My team and I ran into a strange error during one of our recent project deployments to a staging environment. Our application was designed to run on .NET 4.0 runtime with Internet Information Services 7.5. This was a web services application designed to run WCF services with a basic console application for administration purposes. During the deployment of the console application, we ran into this very strange problem. Any time we visited any page we got the following error message from IIS.
HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred.
Detailed error information had the following:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler System.Web.Mvc.MvcHandler
Error Code 0x00000000
Our application utilized ASP.NET MVC 4.0. We looked at our application log, system event logs and any other log we could find on the server. None of the log files had any information about the error itself.
Naturally we started a process of elimination to figure out what could be causing this issue. Since we were deploying to this environment for the first time, we thought may be certain runtime libraries were missing or the OS patch levels were different. After an exhaustive analysis of the server itself, we concluded server was the culprit here.
At this point we started focusing on our application. Our application was designed to use Integrated Windows Security Authentication along with ASP.MET Membership/Role providers for basic role and authorization management. We assumed the problem was happening somewhere in the ASP.NET pipeline before the execution reached our controller. Since we were using the AuthorizeAttribute, we thought it might be a problem with it.
We wrote a very small code to verify whether we can perform authentication and authorization with our security set up. Right there in the code we got the following exception:
HTTP Error 500.0 - Internal Server Error The page cannot be displayed because an internal server error has occurred.
Detailed error information had the following:
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler System.Web.Mvc.MvcHandler
Error Code 0x00000000
Our application utilized ASP.NET MVC 4.0. We looked at our application log, system event logs and any other log we could find on the server. None of the log files had any information about the error itself.
Naturally we started a process of elimination to figure out what could be causing this issue. Since we were deploying to this environment for the first time, we thought may be certain runtime libraries were missing or the OS patch levels were different. After an exhaustive analysis of the server itself, we concluded server was the culprit here.
At this point we started focusing on our application. Our application was designed to use Integrated Windows Security Authentication along with ASP.MET Membership/Role providers for basic role and authorization management. We assumed the problem was happening somewhere in the ASP.NET pipeline before the execution reached our controller. Since we were using the AuthorizeAttribute, we thought it might be a problem with it.
We wrote a very small code to verify whether we can perform authentication and authorization with our security set up. Right there in the code we got the following exception:
Exception Details: System.Configuration.Provider.ProviderException: The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.
We noticed during deployment aspnet_SchemaVersions table did not get properly populated and was missing all of the required entries. Once we populated it the table with the following information
Feature CompatibleSchemaVersion IsCurrentVersion
common 1 True
health monitoring 1 True
membership 1 True
personalization 1 True
profile 1 True
role manager 1 True
it all started working.
Comments