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

49,366

Solution 1

  1. You problem might be on the browser side: make sure that the IE setting to "show friendly messages" is turned off
    enter image description here

  2. Also, on the server side, you must have some setting to allow error messages to be sent to client (sorry, I only have access to the IIS flavor of that setting... not sure what's in Azure):
    enter image description here

Solution 2

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>

Solution 3

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 !!

Solution 4

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.

Solution 5

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!

Share:
49,366
VVee
Author by

VVee

Updated on August 04, 2022

Comments

  • VVee
    VVee almost 2 years

    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.

  • VVee
    VVee about 11 years
    Website is on "Azure Websites" and it does not show an option for "Send Errors To Browser". Also with "Azure websites" there seems to be no remote desktop to server. So I am not sure how to set send errors to browser. I tried the following with no luck <asp scriptErrorSentToBrowser="true"/> in web.config system.webserver section
  • G. Stoynev
    G. Stoynev about 11 years
    Try this: add in web.config to the <system.webServer> section <httpErrors existingResponse="PassThrough" />. I would also try a custom 500.100 page - they must be allowed!
  • PC.
    PC. about 9 years
    Well, thanks for this suggestion. I had it working and later diagnosed that problem was with same file :) +1 Thank you.
  • Rob Wilkins
    Rob Wilkins over 7 years
    I'd second this -- I had a similar issue today, and it turned out that something or someone had modified the web.config, adding in an invalid MIME type extension that was causing all static content requests to fail. Simple to fix, but all rooted in a faulty web.config file for the site.