Dieses Blog durchsuchen

Donnerstag, 26. September 2013

Sitecore 7: Troubleshooting: startIndex cannot be larger than length of string.

Problem:

I stepped i to this error while creating a Package in sitecore. I selected only a big subtree of Database items and no files.

Server Error in '/' Application.

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.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   System.String.Substring(Int32 startIndex) +19
   Sitecore.Install.Items.ItemFieldsProperties.GetFieldsProperties(Item item) +432
   Sitecore.Install.Items.ItemToEntryConverter.InternalConvert(Item item, IProcessingContext context)
   Sitecore.Install.Framework.BaseConverter`1.Convert(T entry, IProcessingContext context) +69
   Sitecore.Install.Framework.InternalSink.Put(T entry) +97
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +104
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Items.ItemSource.RecursivePopulate(Item item, ISink`1 sink) +499
   Sitecore.Install.Framework.BaseSource`1.Populate(ISink`1 sink) +705
   Sitecore.Install.Framework.SourceCollection`1.Populate(ISink`1 sink) +166
   Sitecore.Install.Utils.EntrySorter.Populate(ISink`1 sink) +87
   Sitecore.Shell.Applications.Install.Dialogs.AddStaticItemSourceDialog.EndWizard() +770




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

WORK AROUND:

If I choose a tree with many subitems so may the start index gets too large.  My solution was to choose smaller tree parts. Anyway a nicer message should appear in Sitecore 6.6 update 6 version.

Feedback Sitecore Support:

Hello,
I’m still unable to reproduce the issue at my side even with large database.
So it looks like something specific to your solution.
I suggest you to divide your data into several packages.
If you require deeper investigation, please upload your entire master database at our pubic FTP.

Note:

Always use firefox browser while installing or creating items from "package" or "serialization" because Internet Explorer gets time-out issue while installing a big package.