25 June 2009

DNN Event Viewer spider errors

If you are getting "Page Load Exception" errors in the DotNetNuke (DNN) [Admin][Event Viewer] with the UserAgent indicating a web crawling spider, then you need this fix:

The fix: Get the Browser Caps - v2 by Oliver Hine. Unzip the file App_Browsers.zip to get the file OtherSpiders.browser - put this in the App_Browsers directory of your DNN site. Note that your DNN site will automatically restart, so perhaps do this at a quiet time.

Alternatively (if you want), you should be able to stop these spiders accessing your site using a suitable robots.txt file.

This patch is needed for DNN 4.9.4 and possibly earlier. I think that it may be fixed in DNN 5.1+.

Spiders fixed: This file has fixes for these spiders: Baiduspider, Yandex, ia_archiver, Sphere, Feedfetcher-Google, Yanga, worio, zibber, twiceler, voliabot, aisearchbot, robotgenius and R6_FeedFetcher.

Spiders not fixed: However it doesn't fix TweetmemeBot - I failed to add support for this. Read this Tweetmeme.

Update: doesn't seem to work for Twiceler or voilabot.

What's happening: DNN code is asking ASP.NET for details of the browser capabilities. ASP.NET gets this from the UserAgent string. DNN asks for the major and minor version numbers of the browser and causes an exception if these cannot be determined from the UserAgent. ASP.NET uses various .browser files (in the framework directories and in the web app's App_Browsers directory) to work out what browsers can do. As the UserAgent provided by these spiders doesn't follow a standard regex pattern, ASP.NET cannot get the major and minor versions.

Thanks to: Barry Sweeney for his prompt help on Twitter - and Oliver Hine of course.

Below is the DNN exception that I get before applying this fix:





Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: String ---> System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Web.Configuration.HttpCapabilitiesBase.get_MajorVersion() at DotNetNuke.UI.Utilities.ClientAPI.BrowserSupportsFunctionality(ClientFunctionality eFunctionality) at DotNetNuke.UI.Utilities.ClientAPI.get_ROW_DELIMITER() at DotNetNuke.UI.Utilities.ClientAPI.RegisterClientVariable(Page objPage, String strVar, String strValue, Boolean blnOverwrite) at DotNetNuke.UI.Skins.Controls.Search.Page_PreRender(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) 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.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---

6 comments:

Anonymous said...

I have the same issue on our website, we see lot of pageload exceptions from crawlers websites.

One thing I am not sure is if the site goes down when the exception is raised. This happens very early hours that we cannot check.

Did this fix resolve the issue??

Chris Cant said...

The site does not go down when these exceptions are raised.

With the fix, I think some execptions have now gone away. However we're still getting 'VoilaBot' and 'twiceler' exceptions, but I don't feel too worried about them.

Chris

Mark@LFT said...

Have just read this, and downloaded the file, hope it can reduce this problem for me. I also noticed many people on the DNN forum with the same problem, so I directed them here. ;-)

Thanks for the help.

Anonymous said...

Hi there!

I dhad the same issue and added Olivers "OtherSpiders.browser" File

This reduced the amount of errors in my eventlogs

But there are still other bots that cause this issue
One Of them is the "Yandex-Bot" as i mentioned ... this oneis also not included in the browser-caps for DNN 5.4 as I can see

Is there an updatet version of your "OtherSpiders.browser" File which covers more actual problems?

Thanks in advance
Regards
Gerald

Chris Cant said...

Hi - I haven't looked at this issue for a while, or what preceisley what happens in DNN 5. If anyone has an updated .browser file, pls let me know.

My understanding was that this issue went away in DNN 5, so you didn't need a special .browser file.

Chris

Anonymous said...

Hi, I'm having a similar issue I think, but my site is going down. I've done a restore with my host, and will upload the fix, I think the exception is the same:

AssemblyVersion: 04.09.04
PortalID: 0
PortalName: Mammoth Mountain Vacations
UserID: -1
UserName:
ActiveTabID: 60
ActiveTabName: Mammoth Lodging
RawURL: /Default.aspx?tabid=60&error=Value+cannot+be+null.%0d%0aParameter+name%3a+String&content=0
AbsoluteURL: /Default.aspx
AbsoluteURLReferrer: http://www.mammothmountainvacations.com/
UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 GTB7.1 ( .NET CLR 3.5.30729)
DefaultDataProvider: DotNetNuke.Data.SqlDataProvider, DotNetNuke.SqlDataProvider
ExceptionGUID: 41c4fafb-b915-4cca-bad3-e72cc0feae99
InnerException: Value cannot be null. Parameter name: String
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Number.StringToNumber
StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Value cannot be null. Parameter name: String ---> System.ArgumentNullException: Value cannot be null. Parameter name: String at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.Web.Configuration.HttpCapabilitiesBase.get_MajorVersion() at Solpart.WebControls.SolpartMenu.BrowserSupportsFunctionality(ClientFunctionalityEnums eFunctionality) at Solpart.WebControls.SolpartMenu.DownLevelBrowser() at Solpart.WebControls.SolpartMenu.getBorderStyle(String type, String color, Int32 width) at Solpart.WebControls.SolpartMenu.getMenuBorderStyle(String shColor, String hlColor, Int32 width) at Solpart.WebControls.SolpartMenu.WriteCSSStyles() at Solpart.WebControls.SolpartMenu.Page_PreRender(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) at DotNetNuke.Framework.PageBase.OnPreRender(EventArgs evt) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
Source:
Server Name: WEBD14

Would you happen to know if this could make my site go down?