Azure Websites Troubleshooting : Analysing HTTP errors in KUDU Console
Introduction
KUDU console is an in-built site extension on Azure Websites.
Access
To access this add .scm to the URL as shown below:
http://yoursitename.scm.azurewebsites.net/ (Replace yoursitename with name of your site)
Access this link in Internet Explorer.
Hit ALT+V and select Toolbars and then Favorites bar.
This will add a shortcut to the KUDU console in the favorites bar as shown below:
Unexpected error
1. Launch Internet Explorer and browse your site http://<yoursitename>.azurewebsites.net/
On the page click on Unexpected Error.
You will see the following error on the browser:
1. In IE, go to ToolsàInternet Options
1.
Click on Advanced tab and select “Show friendly HTTP error messages”
Hit CTRL+F5 and you will see the actual error message.
1. This indicates we are getting a 500 error.
Enable HTTP Logging for the site
1. In Visual Studio, right click the site and select View Settings as earlier.
Enable Web Server Logging as shown below:
1.
2. Browse the page https://<yoursitename>.azurewebsites.net/Unexpected/Default.aspx
(Replace <yoursitename> with name of your site)
3. You will get the error message as seen earlier.
4. Go to the KUDU Console for your site.
5. Click on Debug Console and select CMD.
6. You will see a explorer view of the directory structure for the site.
7. Browse to Logfiles à http à RawLogs.
You will see the http log file generated here. Click on the edit (pen icon) as shown below:
1. You will find entries with HTTP status code set to 500.19.
2015-03-06 12:53:40 AZCONF15 GET /Unexpected/Default.aspx X-ARR-LOG-ID=a5e3e912-ca76-451d-a538-d43c80fb3255 80 - 167.220.236.13 Mozilla/5.0+(Windows+NT+6.3;+WOW64;+Trident/7.0;+Touch;+rv:11.0)+like+Gecko ARRAffinity=54fc7ad43555a17449bdf1c1be0ab2483d56ea4a5f9e0c01049c06ebecf902d7 - azconf15.azurewebsites.net 500 19 13 453 968 78
Enabling Detailed Error logs to determine the problem
1. In Visual Studio, right click the site and select View Settings as earlier.
Enabled Detailed error logging as shown below:
1. Browse the page https://<yoursitename>.azurewebsites.net/Unexpected/Default.aspx
(Replace <yoursitename> with name of your site)
2. You will get the error message as seen earlier.
3. Go to the KUDU Console for your site.
4. Click on Debug Console and select CMD.
5. You will see a explorer view of the directory structure for the site.
6. Browse to Logfiles à DetailedErrors.
Click on the download icon as shown below:
This will launch another IE instance where you can see the log indicating the reason behind the problem:
Yellow Screen of Death
1. Launch Internet Explorer and browse your site http://<yoursitename>.azurewebsites.net/
On the home page, click on Yellow Screen of Death.
This will result in the error as shown below:
1. We will try to determine the reason behind this errors without turning of custom errors via web.config.
1. Go to the KUDU Console
Select Tools à Support
This will launch the Azure Websites Support portal.
Click on Analyze and then click on Event Viewer.
The Event Viewer is a site extension which mimics the view similar to the desktop version of Event Viewer.
Here is the screenshot of the view:
1. Analyze the Details section (highlighted in red above) to determine what is causing the error message.
2. Scroll down to the bottom of the Details section to know the reason behind the error. Below is a snippet of the section:
Thread information:
Thread ID: 16
Thread account name: IIS APPPOOL\azconf15
Is impersonating: False
Stack trace:
at SharedComponents.Utilities.GetData() in e:\ComProjects\AzConf2015\SharedComponents\Utilities.cs:line 33
at MAWSHOL.YSOD.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)