Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The page cannot be displayed because an internal server error has occurred", Azure Website,

Tags:

web

azure

I have deployed the azure website to East US location, Reserved instance. I have CustomErrors=On. After few minutes of work (with quite good performance) app is hanging, slowing down. (I don't see any errors in elmah.) After that starts to return 500 error. My custom error page is not displayed (I see only "The page cannot be displayed because an internal server error has occurred." in plain text) so I can't even customize it. Then the app is restarted. We cannot go into production like that. I don't know what to do.

like image 917
user235681 Avatar asked Mar 29 '13 12:03

user235681


People also ask

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

Description of HRESULT The page cannot be displayed because an internal server error has occurred. This problem occurs because the server that is running IIS 7.0 cannot access the configured root directory of the requested location.

How do I fix error 500 in Chrome?

If you are receiving an “Error 500 – Internal Server Error” message while trying to log into Canvas, you will need to clear the cookies on your web browser to resolve this issue.

How do I fix 500 Internal server Error in 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.


2 Answers

I had this same issue with VS2013 today.

My WCF-Services website worked fine locally, but it refused to work when it was published to Azure.

In VS2013 Update 2, I imported the Azure Publish Profile file, published to Azure, but always got this message:

The page cannot be displayed because an internal server error has occurred

Even my basic Default.htm file, which displayed a simple "This is default.htm" message, refused to display, and, again, I'd just get that same message.

Solution

Thankfully, I had a second WCF-Service which was publishing correctly to Azure, so I compared it's web.config file to the "faulty" project's web.config file.

I found that I needed to manually strip the "system.web" section down to just this:

<system.web>
   <compilation debug="true" targetFramework="4.5" />
   <httpRuntime targetFramework="4.5" requestPathInvalidCharacters="" />
</system.web>

(which removed a load of assemblies, pages\controls, httpHandlers and httpModules stuff) and also completely get rid of the "system.webServer" section.

Once I'd done this, I could publish to Azure, and it'd all work fine.

Hope this helps.

like image 118
Mike Gledhill Avatar answered Sep 26 '22 06:09

Mike Gledhill


The best advice I can give to troubleshoot your problem is to check the website diagnostics logs. You can download log locally as described here.

If you use new Windows Azure Powershell 0.6.12 you can use Powershell commands to download the logs directly using the following commands:

azure site log tail [options] [name] //{Retrieves the value for the selected key}
  --filter - Filter to match against for displaying log output.
  --log - Write output in a log format.

Above command streams live diagnostic logs from your website to the console --path [path] - Path under the LogFiles folder to pull logs from.

More info on PS: https://github.com/windowsazure/azure-sdk-tools-xplat

Also you can contact Azure Websites team through forums and ask for assistance.

like image 36
AvkashChauhan Avatar answered Sep 24 '22 06:09

AvkashChauhan