U4-4949 - startIndex cannot be larger than length of string YSOD in multi domain setup

Created by Richard Soeteman 20 May 2014, 06:52:16 Updated by Chris 11 Nov 2014, 14:17:29

Currently testing a multi domain situation. I have two root nodes

  • Home
  • HomeNL

Only on HomeNL I've assigned the domain test.local/nl. To Home I didn't assign a domain. When I access test.local. the YSOD as shown below is thrown. When I explicit assign test.local to the Home node it all works fine. I think it should display the home node when test.local is used without assigning a domain since that is the first node or at least a normal error is shown instead of a YSOD.

YSOD:

startIndex cannot be larger than length of string. Parameter name: startIndex 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: startIndex cannot be larger than length of string. Parameter name: startIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: startIndex cannot be larger than length of string. Parameter name: startIndex] System.String.Substring(Int32 startIndex, Int32 length) +13911679 Umbraco.Web.Routing.DomainHelper.PathRelativeToDomain(Uri domainUri, String path) +94 Umbraco.Web.Routing.ContentFinderByNiceUrl.TryFindContent(PublishedContentRequest docRequest) +267 Umbraco.Web.Routing.PublishedContentRequestEngine.b__2a(IContentFinder finder) +81 System.Linq.Enumerable.Any(IEnumerable1 source, Func2 predicate) +149 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContent() +536 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContentAndTemplate() +349 Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +254 Umbraco.Web.Routing.PublishedContentRequest.Prepare() +62 Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +1259 Umbraco.Web.UmbracoModule.b__a(Object sender, EventArgs e) +171 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34009

Comments

Stephan 20 May 2014, 07:06:22

Reproduced.


Stephan 20 May 2014, 07:22:26

Caused by completely stupid changes I did in acd377956f14e903ae277b0f4a7c3a7498668291. Fixing.


Stephan 20 May 2014, 07:27:35

Pushed 2926a79c3ff9278008ce302116f49bed35be7fcb to 7.1.4. Pushed f325794523d03200e2a4d378327710546318795d to 6.2.1. Fixed.


Chris 21 May 2014, 18:00:35

I had the same issue on our production website. We have two nodes at the root: ''/en'' and ''/fr''

To temporary work around the issue I added the following in configs/UrlRewriting.config

 <add name="HomeIsEnglish" virtualUrl="^~/$" destinationUrl="~/en" ignoreCase="true" />

This will show the content of ''/en'' when you visit ''/'' instead of and error.


Priority: Normal

Type: Bug

State: Fixed

Assignee: Stephan

Difficulty: Normal

Category: Architecture

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.2.0, 7.1.3

Due in version: 6.2.1, 7.1.4

Sprint:

Story Points:

Cycle: