Tuesday, March 10, 2009

You are not authorized to view this page


One clear morning, on an operational system (Windows 2003 x64, IIS, ASP.NET, SQL Server 2005) running an ASP.NET application, the users started to get request to fill their credentials, and after few times they got:
You are not authorized to view this page

With more specific notification:
HTTP Error 401.1 - Unauthorized: Access is denied due to invalid credentials.Internet Information Services (IIS)

In the event log of the server I found the following errors:
- System Events - I found warning event 1011 titled "W3SVC":
A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '6756'. The data field contains the error number.

- Application Events - I found error event 1000 titled ".NET Runtime 2.0 Error Reporting":
Faulting application w3wp.exe, version 6.0.3790.3959, stamp 45d691cc, faulting module kernel32.dll, version 5.2.3790.4062, stamp 462643a7, debug? 0, fault address 0x0000000000027d8d.


I followed few wrong leads on the web, such as:

After wasting nearly a day a found the root cause:
The ASP.NET application had a stack-overflow bug.

From here fixing is easy.

The reason that I didn't suspected the ASP.NET application was that the stack-overflow bug was caused by a run time change of the data in the application, and not something new installed/configured.


Aymen said...

can you please tell me how you fix it?

Anonymous said...

Yes, PLEASE! What is the fix???? I'm having the same issue.

Sagi said...

Aymen & Colin - It's a bit late (2 years) - but there's no out-of-the-box solution. In my case it was a stack overflow problem caused by my code in the ASPX. Check if your code is not causing stack overflow (infinite recursion for example).