As noted in my previous blog posting I have upgraded this website to be running DotNetNuke 4.6.0.  Prior to the upgrade this site was running DNN 4.5.2 and I performed a direct upgrade to 4.6.0.  Also as I mentioned in my previous posting the upgrade didn't go all that smooth, with the site being down for almost an hour as I worked out the "bugs" that I identified with the 4.6.0 upgrade.  This article will discuss one of the issues that I encountered relating to the Whitespace Filter.

First of all to give a little background as all of you are aware this site had been up and running on 4.5.2 since shorlty after it was released, the site was first created as a DNN 4.3.7 site, then upgraded to 4.4.1 when it came out, then to 4.5.0 and 4.5.2.  The reason I mention this is that I am NOT 100% sure what the root cause was for this issue, so I am not 100% sure if it is a true "bug" in the upgrade process as a whole or if there is a specific series of events that had occured beforehand that made the situation worse.

Previously I had my website performance settings configured to store cache information in memory with heavy caching.  I had compression turned off and I had the whitespace filter turned on.  The whitespace filter configuration was 100% standard DNN with no modifications.  When I performed the site upgrade the entire upgrade went off without any errors or warning messages.  When I navigated to my website after the upgrade I was greeted by the standard .NET exception message referring to "object reference not set to an instance of an object"  The full stack trace is below.

[NullReferenceException: Object reference not set to an instance of an object.]
   DotNetNuke.HttpModules.Compression.WhitespaceFilter.Write(Byte[] buf, Int32 offset, Int32 count) +104
   System.Web.HttpWriter.Filter(Boolean finalFiltering) +251
   System.Web.HttpResponse.FilterOutput() +60
   System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +29
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

Looking at this stacktrace I was able to instantly identify the WhitespaceFilter as the culprit, luckly there was an easy fix.  Since the site was unusable at this point in time I used the following SQL query to turn off the filter.

UPDATE HostSettings
SET SettingValue 'N'
WHERE SettingName 'WhitespaceFilter'

After executing this script I was able to fully view the site and all functionality has been restored.  I have not yet been brave enough to re-enable the filter, but I have been informed that it does work!  Hopefully this can help you resolve the issue quickly if you encounter it!  Please share your comments below!