Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > Error on Firefox only that seems to be related to Analytics Browser Tracking View modes: 
User avatar
Member
Member
Stratego - 3/18/2011 2:50:40 AM
   
Error on Firefox only that seems to be related to Analytics Browser Tracking
My newly built web site hosted on Windows Server 2008 R2 was working fine for several days then suddenly stopped working with every page giving the same error but only on Firefox (version is 3.6.15) and not on Safari nor on MIE.

The error was.....

Server Error in '/' Application.
________________________________________
Index and count must refer to a location within the string.
Parameter name: count
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.ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count

Source Error:

Line 1034: if (AnalyticsHelper.TrackBrowserTypesEnabled(siteName.Value))
Line 1035: {
Line 1036: string browser = HttpContext.Current.Request.Browser.Browser + HttpContext.Current.Request.Browser.MajorVersion.ToString() + "." + (HttpContext.Current.Request.Browser.MinorVersion > 0 ? HttpContext.Current.Request.Browser.MinorVersion.ToString().Remove(0, 2) : "0");
Line 1037: HitLogProvider.LogHit(HitLogProvider.BROWSER_TYPE, siteName.Value, null, browser, 0);
Line 1038: }

Source File: c:\inetpub\wwwroot\SinclairBlack1\App_Code\Global.asax.cs Line: 1036

I do not have Web Analytics enabled.

I unchecked "Track browser types" in Web Analytics and the error went away.

Strangely I checked it back on and the error did not reappear.

Firefox version details are Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729; .NET4.0C)

It is possible that it fixed itself by coincidence when I walked over to my mac as I didn't try again on Firefox but I don't think that is likely.

User avatar
Member
Member
Stratego - 3/19/2011 6:01:05 PM
   
RE:Error on Firefox only that seems to be related to Analytics Browser Tracking
This error has reappeared two days later with absolutely nothing being changed in the web site or the server.

It is probably an environment issue because it only occurs on the host Windows Server 2008 R2 (which happens to be running in a Virtuozzo container) and is not constantly a problem.

It has never happened on my Vista dev machine.

So that it fails more elegantly, I have put a try/catch around the line in App_Code\Global.asax.cs but would appreciate a more robust solution as this comes and goes and some day my client may want to switch web analytics on.

I removed the try/catch and got the error again, then put it back and it fixed it a second time.

if (AnalyticsHelper.TrackBrowserTypesEnabled(siteName.Value))
try
{
string browser = HttpContext.Current.Request.Browser.Browser + HttpContext.Current.Request.Browser.MajorVersion.ToString() + "." + (HttpContext.Current.Request.Browser.MinorVersion > 0 ? HttpContext.Current.Request.Browser.MinorVersion.ToString().Remove(0, 2) : "0");
HitLogProvider.LogHit(HitLogProvider.BROWSER_TYPE, siteName.Value, null, browser, 0);
}
catch
{
}


User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 3/24/2011 9:32:35 AM
   
RE:Error on Firefox only that seems to be related to Analytics Browser Tracking
Hello,


we were solving the issue via e-mails. For other visitors:

Please apply the latest hotfix for the version 5.5 or upgrade to the version 5.5 R2 and apply the latest hotfix for that. It should fix the issue. You can download the hotfixes here: Hotfixes. There was a bug in the version 5.5. I am sorry for your inconveniences.


Best regards,
Helena Grulichova