Backend pages Null Reference Exception

Posted by Community Admin on 04-Aug-2018 13:38

Backend pages Null Reference Exception

All Replies

Posted by Community Admin on 05-Oct-2017 00:00


We are getting a null reference exception when viewing any back-end pages.

This happened all of a sudden a few days ago and again today.

We had to restore the database to fix this last time.

Here is what is in the error log and event viewer:

Process information: 
    Process ID: 7356 
    Process name: w3wp.exe 
Exception information: 
    Exception type: NullReferenceException 
    Exception message: Object reference not set to an instance of an object.
   at Telerik.Sitefinity.Services.InactiveModule.Start(SiteInitializer initializer)
   at Telerik.Sitefinity.Services.SystemManager.GetApplicationModule(String name)
   at Telerik.Sitefinity.Services.SystemManager.GetModule(String name)
   at Telerik.Sitefinity.Web.BackendSiteMap.IsPageNodeEnabled(PageNode pageNode)
   at Telerik.Sitefinity.Web.SiteMapBase.GetChildNodes(SiteMapNode parent, Boolean ifAccessible)
   at System.Web.SiteMapNode.get_HasChildNodes()
   at Telerik.Sitefinity.Web.UI.Backend.MainMenu.IsNodeEmpty(PageSiteNode node)
   at System.Linq.Enumerable.WhereArrayIterator`1.MoveNext()
   at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)
   at Telerik.Sitefinity.Web.UI.Backend.MainMenu.IsNodeEmpty(PageSiteNode node)
   at Telerik.Sitefinity.Web.UI.Backend.MainMenu.CreateRadMenuItemFromNode(SiteMapNode node)
   at Telerik.Sitefinity.Web.UI.Backend.MainMenu.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.AddedControl(Control control, Int32 index)
   at System.Web.UI.Control.EnsureChildControls()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Posted by Community Admin on 06-Oct-2017 00:00

Can you tell us more about your environment? Server, Azure, IIS version, Sitefinity version,  .NET  version.  Where are your Sitefinity configs stores, files system or database?  Does recycling the app pool fix it? Is there any other error in the error log files. Are they any major changes happening to the site before this occurs, a change to a template that all the pages use or anything like that?  Any customization to backend?

Posted by Community Admin on 06-Oct-2017 00:00

Hi Jonathan, thank you for replying.

The server environment is as follows:

Windows server 2012 R2 Standard, IIS 8.5, Sitefinity 9.2, .NET 4.6.2.


Configurations are set to "Auto" in the web.config.

I have tried both File System and Database with an app pool recycle and saw the same results, even tried using configs from an earlier backup.

It's just this error over and over for each person trying to access the backend, here's some additional information from the log file:

Extended Properties: 
Timestamp: 10/5/2017 1:11:34 PM

Message: HandlingInstanceID: eba99509-bd9c-43f9-8b3e-c274461a388b
An exception of type 'System.NullReferenceException' occurred and was caught.
10/05/2017 09:11:34
Type : System.NullReferenceException, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : Object reference not set to an instance of an object.
Source : Telerik.Sitefinity
Help link : 
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Start(Telerik.Sitefinity.Abstractions.SiteInitializer)
HResult : -2147467261



No major changes that I'm aware of it's actually towards the end of the day that it has happened.


There are some added backend pages, they have their own widgets. and a small amount of jquery to add an additional link where the site to the site is on the top right. those have all been in place for months, this just started last week.

Posted by Community Admin on 06-Oct-2017 00:00

Does the frontend still serve pages correctly?  In your web.config on the <compilation> attribute what is your numRecompilesBeforeAppRestart set too? Try increasing it to 1000 or 2000. This basically says how many edits before the site recycles. It might be a long shot but won't hurt to increase it.

Do you have any logic in the global.ascx in app_start or any other methods? 

Posted by Community Admin on 06-Oct-2017 00:00

The front end is perfectly fine, you can still use all the custom widgets, browse etc.

The numRecompilesBeforeAppRestart is set to 50, i'm guessing thats the default.

I'll up this to 1000 and see if the issue doesn't come back.


There is logic in Appication Start and End Request.

End Request does the following, at the time we couldn't figure out how to have pages that redirect to another page not cache as a 301 so we overrode it:

 protected void Application_EndRequest(object sender, EventArgs e)
            //skip public pages and possible moves from old site
            if (!Request.Url.PathAndQuery.ToLower().Contains("public") && !Request.Url.PathAndQuery.ToLower().Contains("aspx"))
                if (Response.StatusCode == 301)
                    Response.CacheControl = "NO-CACHE";
                    Response.StatusCode = 302;


App start just registers the bootstrapper initialized event and subscribes to these as well as registering two custom routes:

EventHub.Subscribe<IFormEntryCreatedEvent> - different purpose

Posted by Community Admin on 06-Oct-2017 00:00

Have a look at this knowledge base article and lets see if you can get more details about the error.

The other suggestion would be to use something like dotTrace to see if there are un-handled errors or bottle necks that cause server resource drain.

Posted by Community Admin on 30-Oct-2017 00:00

Just as a followup, the suggestion of increasing numRecompilesBeforeAppRestart to 1000 has thus far prevented the problem from appearing, in the past three weeks.

Thank you.

Posted by Community Admin on 09-Nov-2017 00:00

The error returned this morning, i tried upping the value to 2000, no difference. any help would be appreciated, this system is supposed to be moving to production within a week.

Posted by Community Admin on 15-Nov-2017 00:00

Have you tried using the sitefinity diagnostic module?

Is this hosted on premises or cloud?

This thread is closed