Saturday, March 24, 2012

PageRequestManagerServerErrorException: 401

I wrote some server code that work fine in VWD 2008 Express Edition. When I uploaded the page to my site (including the dll that my code uses), I get the following error:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occured while processing the request on the server. The status code returned by the server was: 401. How can I find out where the problem is comming from?

Thanks,
Yoni

Server Error 401 is an "Unauthorized" error.


And how can I find out which peace of code is giving me this error?

Thanks,
Yoni


It's probably going to be something where it is trying to access a page, database, etc. that it doesn't have permissions to. I would set breakpoints and just see how far the code is getting.


Thats a problem. As I said, the page and code work fine on my computer - only when I move it to my site I get an error. How do I insert breakpoints? Do you mean I should use "return" statements in diff places until I find where the error originates?

Thanks,
Yoni


On the server you couldn't use breakpoints. I personally am a fan of just putting an extra blank <asp:Label> on the page and writing things to it to see values and my progress. Place occasional "I got to ____ function" statements in the label's text.


I wouldlove to do that: I have tried it, but it doesn't work. My server code takes about 10 seconds - 5 minutes to run and during that time I can't post nothing to the page... I asked how to do this in another forum, but I was given extremely complicated ways of doing this, that I could not do. Do you know how I can change a label while my server code is running?


Hi,

Thank you for your post!

Check out the following link:

http://blogs.msdn.com/david.wang/archive/2005/07/14/HOWTO_Diagnose_IIS_401_Access_Denied.aspx, David Wang said in this article:

One of the most common questions asked about IIS on the newsgroups as well as Microsoft Product Support is "why am I getting 401 Access Denied"?

There are many, many possible causes and variations, but from the IIS perspective, the top-level, logical categories are fixed. This information can help dramatically narrow down the scope of any investigation, but unfortunately, few people know to take advantage of this information. This is what I am going to address with this entry - how to use and diagnose the 401.x error codes on IIS.

Step 1: Determine the SubStatus Code

Step 2: Determine Course of Action

401.1 Denied by Invalid User Credentials

401.2 Denied by Server Configuration

401.3 Denied by Resource ACL

401.4 Denied by Custom ISAPI Filter

401.5 Denied by Custom ISAPI/CGI Web Application

Conclusion

401.1 through 401.3 errors are associated with IIS request processing and allow the logical interpretations and assumptions that I listed above.

Meanwhile, the 401.4 and 401.5 errors are the most arbitrary to diagnose since custom ISAPI DLLs and CGI EXE can cause IIS to behave in non-obvious manners. Thus, much of the logical assumptions about 401.x do not apply.

I hope that this information has been useful in deciphering theh 401.x errors from IIS. If you have additional questions, feel free to post a comment or post a private question via the "contact" link.

Recently, we have also released a tool,AuthDiag, to help troubleshoot IIS access denied issues. You can download it fromthis location. In particular, it has a feature to hook in to various failure points in IIS and directly troubleshoot what is failing on a given request - you need to see and try it out!

If you have further questions, let me know.

Best Regards,

No comments:

Post a Comment