fandrei / AppMetrics

Apache License 2.0
8 stars 2 forks source link

Browsing to http://metrics.cityindex.com/Config.aspx from server on a fresh install throws NullReferenceException #100

Closed mrdavidlaing closed 12 years ago

mrdavidlaing commented 12 years ago

Browsing to http://metrics.cityindex.com/Config.aspx from server on a fresh install throws following error:

Server Error in '/' Application.

Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] AppMetrics.Config.Page_Load(Object sender, EventArgs e) in c:\dev\workspace\AppMetrics\AppMetrics\Config.aspx.cs:26 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +24 System.Web.UI.Control.LoadRecursive() +70 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3063

mrdavidlaing commented 12 years ago

A manual fix requires the following steps:

  1. Create `D:\Websites_AppMetricsData\settings.xml`` with the following content

     <?xml version="1.0" encoding="utf-8"?>
     <AppSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <RequireAccessKey>true</RequireAccessKey>
     <AccessKeys>
         <string>{501-your-key}</string>
      </AccessKeys>
    </AppSettings>
  2. Ensure metrics website has correct acls for new file - icacls d:\websites /grant "IIS AppPool\metrics.{your_tld}":F /T /inheritance:e
  3. Restart metrics website - %windir%\system32\inetsrv\appcmd recycle apppool "metrics.{your_tld}"
mrdavidlaing commented 12 years ago

Have updated AppMetrics installation instructions - Configure Access Keys to get around this issue manually.

When it is fixed the instructions need to be fixed too.

fandrei commented 12 years ago

Fixed. Manual workaround is not necessary