Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > [5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits View modes: 
User avatar
Member
Member
michiel - 5/31/2010 2:53:32 AM
   
[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
I consistently get the exception below in Firefox browsers. it seems related to the web analytics module. It happens on all pages, but not on other sites on the same application instance. The exception stops occuring when I disable the option Track browser types.
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:\sites\vhosts\vpsshared.app\httpdocs\App_Code\Global.asax.cs Line: 1036

Stack Trace:

[ArgumentOutOfRangeException: Index and count must refer to a location within the string.
Parameter name: count]
System.String.RemoveInternal(Int32 startIndex, Int32 count) +0
System.String.Remove(Int32 startIndex, Int32 count) +22
Global.LogVisitor(SiteNameOnDemand siteName) in c:\sites\vhosts\vpsshared.app\httpdocs\App_Code\Global.asax.cs:1036
Global.RewriteUrl(String relativePath, ExcludedSystemEnum excludedEnum, ViewModeOnDemand viewMode, SiteNameOnDemand siteName) in c:\sites\vhosts\vpsshared.app\httpdocs\App_Code\Global.asax.cs:571
Global.Application_AuthorizeRequest(Object sender, EventArgs e) in c:\sites\vhosts\vpsshared.app\httpdocs\App_Code\Global.asax.cs:320
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

User avatar
Member
Member
michiel - 5/31/2010 3:19:29 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Actually, it does happen in other sites, almost all of them. We had to turn off browser tracking for the whole app instance.

User avatar
Member
Member
webmestre-sogique - 6/21/2010 8:45:06 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
michiel wrote: I consistently get the exception below in Firefox browsers. it seems related to the web analytics module. It happens on all pages, but not on other sites on the same application instance. The exception stops occuring when I disable the option Track browser types.

I am getting the exact same error in v5.5.3789, but with the Google analitycs webpart added on the masterpage. As there is no option for the Track browser types in this webpart, i am unable to use this webpart at the moment. The only option selected in the webpart is the Multiple top-level domains.

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/1/2010 6:06:31 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Hello,

1. Is it related to Firefox, too?

2. What version of Firefox do you use?

3. What is the related event log in Site manager -> Administration -> Event log?

4. What version of .NET do you use?

Thank you in advance for your reply.

Best regards,
Helena Grulichova

User avatar
Member
Member
webmestre-sogique - 7/5/2010 8:21:41 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Hello,

1. Yes, Firefox only
2. We tried on multiple station running other versions of firefox, but mine is 3.6.4
3. As our site is now live, i can't reactivate the option to create a log entry :(
4. .Net 4

Thanks

User avatar
Kentico Developer
Kentico Developer
kentico_helenag - 7/8/2010 2:28:53 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Hello,

1. we would need the full text of error message you get (the stack trace)

2. did you switch off the web analytics module for testing purpose? We would need to know if the issue is related to Google analytics web part or it is the same problem with web analytics as Michiel described.

Thank you in advance for your reply.

Best regards,
Helena Grulichova

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 7/31/2010 4:24:10 PM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Hi all,

We have further information about this error.
This has been recently discovered as a bug and has been fixed in 5.5.9 Hotfix release.
I'm very sorry for the inconvenience it has brought to you.

The problem was in detection of the browser version. The code for that has been rewritten.
To solve this issue, please apply at least this hotfix version, preferably the latest one available.

Thank you for your understanding.

Best regards
Zdenek C.

User avatar
Member
Member
michiel - 8/2/2010 2:23:45 AM
   
RE:[5.5.0] System.ArgumentOutOfRangeException in \App_Code\Global.asax.cs for Firefox visits
Ok, thanks for letting us know. I don't think I saw it in the bugtracker though.