Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classic ASP Website on Azure "The page cannot be displayed because an internal server error has occurred."

We have migrated an application written in classic asp to Azure websites (shared) and some pages simply give the error "The page cannot be displayed because an internal server error has occurred." with out any details. These pages work fine under IIS 7 or using IIS express. How ever on Azure website they do not.

As suggested in some other posts I have configured the following for the website on Azure:

1) Web Server Logging - ON
2) Detailed Error Messages - ON
3) Web.config - customErrors mode to off.

<customErrors mode="Off"/>
 <compilation debug="true" targetFramework="4.0">

Still the log messages do not provide any more details what is wrong and simply gives the following information:

Detailed Error Information:

Module IsapiModule
Notification ExecuteRequestHandler
Handler ASPClassic
Error Code 0x00000000

Any help is appreciated how to debug the classic asp pages issues on Azure websites. Thank you.

like image 548
VVee Avatar asked Mar 20 '13 18:03

VVee


People also ask

How do you fix the page Cannot be displayed because an internal server error has occurred?

The page cannot be displayed because an internal server error has occurred. If running on Azure, have a look at site slots. You should warm up the pages on a staging slot before swapping it to the production slot.

What does this mean the page Cannot be displayed because an internal server error has occurred?

When a error is 500, that means it's an internal error, meaning internal to the service - the service threw an exception that was not caught. Look in the Windows event logs on the server to see what went wrong. Also, try: - Go to menu Tools/Internet Options in your IE.

What does internal server error has occurred mean?

When you hit an internal server error it usually means some parts of your web server is not configured correctly or the application is trying to do something and the server is failing to carry out the request due to a conflict or restriction. This error can only be resolved by fixes to the Web server software .

How do I fix 500 internal server error IIS?

IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.


4 Answers

If you're trying to configure your site where you don't have access to IIS, such as an Azure Web App, you can configure Classic ASP settings in the Web.Config.

Under

<system.webServer>

You can place an

<asp>

element which configures various things with how Classic operates.

The property which was affecting my site was

**appAllowDebugging="true"**

While this property is fine and dandy when you're developing with Visual Studio and have a Just-In-Time debugger installed, it messes up the error handling for Classic Asp.

BTW, took me forever to figure out what I changed.

like image 93
LarryBud Avatar answered Oct 16 '22 20:10

LarryBud


Thank you G. Stoynev! It worked after adding the custom error asp page! I used the code from the following link to create custom error asp page

http://support.microsoft.com/kb/224070

Also the following link as well helped http://www.tacticaltechnique.com/web-development/classic-asp-getlasterror-in-iis7/

Now the system.webServer section in my web.config looks as follows:

<system.webServer>
    <validation validateIntegratedModeConfiguration="false"/>
    <modules runAllManagedModulesForAllRequests="true"/>
    <httpErrors> 
     <remove statusCode="500" subStatusCode="100" />
     <error statusCode="500" subStatusCode="100" prefixLanguageFilePath="" path="/errors.asp" responseMode="ExecuteURL" /> 
   </httpErrors> 
  </system.webServer>
like image 23
VVee Avatar answered Oct 16 '22 20:10

VVee


One (odd) thing to try, which worked for me:

Try FTP'ing onto your Azure website, and rename your web.config to something completely different.

I renamed mine to web.config2 - the Azure "The page cannot be displayed because an internal server error has occurred." error message disappeared, and my ASP.Net application burst into life again.

From there, I recreated the web.config from scratch, copying chunks of it from my original version, piece by piece (to see what was causing the problem)

Yeah, I know... it's a dumb suggestion, but Azure was giving me no hints about what was causing the error, even with logging turned on, and this saved my sanity !!

like image 7
Mike Gledhill Avatar answered Oct 16 '22 18:10

Mike Gledhill


To make the detailed error messages be sent to the browser you need to enable the scriptErrorSentToBrowser attribute as below.

  <system.webServer>
       <asp scriptErrorSentToBrowser="true" />
  </system.webServer>

It goes without saying this could be a potential security risk so shouldn't be left enabled!

like image 1
David Lindon Avatar answered Oct 16 '22 19:10

David Lindon