Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

EPiFind Indexing error

Vote:
 

Hi 

When I ran find index on my commerce site, I received the following error, I have already spent a few hours, but still couldn't figure out what caused this. 

WARN EPiServer.Find.Cms.ContentIndexer: XXXXX-6JMQF72: An exception occurred during reindex operation. System.AggregateException: One or more errors occurred. ---> System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(String format, Object[] args)
   at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& numberOfBatchErrors, Int32& indexingCount)
   at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& numberOfBatchErrors, Int32& indexingCount)
   at EPiServer.Find.Cms.ContentIndexer.<>c__DisplayClass12.b__9(IEnumerable`1 currentBatch, ParallelLoopState loopstate)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
   at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`2 body)
   at EPiServer.Find.Cms.ContentIndexer.ReIndex(Action`1 statusAction, Func`1 isStopped)
---> (Inner Exception #0) System.FormatException: Input string was not in a correct format.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(String format, Object[] args)
   at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& numberOfBatchErrors, Int32& indexingCount)
   at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& numberOfBatchErrors, Int32& indexingCount)
   at EPiServer.Find.Cms.ContentIndexer.<>c__DisplayClass12.b__9(IEnumerable`1 currentBatch, ParallelLoopState loopstate)
   at System.Threading.Tasks.Parallel.<>c__DisplayClass42_0`2.b__1()
   at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
   at System.Threading.Tasks.Task.<>c__DisplayClass176_0.b__0(Object )<--->



#144487
Feb 13, 2016 7:55
Vote:
 

Switch on logging on info level? See if that gives some more information on what content and what property Find has problem parsing...

Looks like it's trying to do a string format on some field which doesn't work as expected. 

#144490
Feb 13, 2016 11:26
Vote:
 

Hi Daniel

The result was captured on the info level. 

#144491
Feb 13, 2016 12:43
Vote:
 

Let's hope someone recognize the problem otherwise I guess a support issue. If they can't fix it I would use conventions to remove half of the content types from index and repeat until you find the content type and property that is messing up the index. Binary search...

#144492
Feb 13, 2016 13:33
Vote:
 

Hi,

you could add more logging for Find by adding a new log appender to EPiServerLog.Config:

  <appender name="findRollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
    <file value="App_Data\Find.log" />
    <appendToFile value="true" />
    <datePattern value=".yyyyMMdd.'log'" />
    <rollingStyle value="Date" />
    <threshold value="Debug" />
    <layout type="log4net.Layout.PatternLayout">
      <conversionPattern value="%date %level [%thread] %type.%method - %message%n" />
    </layout>
  </appender>
  <logger name="EPiServer.Find">
    <level value="DEBUG" />
    <appender-ref ref="findRollingLogFileAppender" />
  </logger>

This way, you should get debug logging with information which shows you witch content id's are being indexed, something like:

Starting indexing of batch with the following Content:5,6,9,13,16,40,44,47,179,182,186

Then you could set reduse the batch size of the content indexer and set the numbers of thread to 1 to make it easier to spot the possible IDs that are causing the issue:

ContentIndexer.Instance.ContentBatchSize = 5;
ContentIndexer.Instance.MaxThreads = 1;

#144514
Feb 15, 2016 9:17
Vote:
 

Hey mate,

Long time no see :)

I have similar issue and after digin down found the problem in below:

EPiServer.Find.Cms.ContentIndexer.ReIndex()

catch (Exception ex)
      {
        if (Enumerable.Count<IContent>(content) == 1)
        {
          Interlocked.Increment(ref numberOfBatchErrors);
          string format = "{0}: An exception occurred while indexing content {1]: {2} {3}";
          ContentIndexer._logger.Error((object) string.Format(format, (object) Environment.MachineName, (object) Enumerable.ElementAt<IContent>(content, 0).get_ContentLink(), (object) ExceptionExtensions.ExplainIndexException(ex), (object) string.Empty), ex);
          statusAction(new ContentIndexer.ReIndexStatus()
          {
            Message = string.Format(format, (object) Environment.MachineName, (object) ExceptionExtensions.ExplainIndexException(ex), (object) "(see log for more information)"),
            IsError = true
          });
        }

As you can see "{1]" is a problem. So this bit of code report the content index error and need to carry one when the reporting is finished. But it throw and exception and just stop. I ran services started with "Remove" in admin area and problem goes away. But this is just shortcut but there is a ticket with EPiServer to resolve that bit of code.

#144882
Feb 21, 2016 22:23
Vote:
 

A previous bug was reported for this issue. For your reference, the bug is #FIND-138

#145041
Feb 24, 2016 3:58
Vote:
 

Hey Trung

I can't find this bug no. from the bug list, do you have any ETA for this? Is there any alternative for fixing this issue?

Thanks

#145451
Mar 04, 2016 1:00
Vote:
 

Hey Aria

HAHA, yes, long time no see, we should have a catch up :) 

Regarding to this issue, which remove task did you run to fix this issue? I ran all 4 remove jobs with no luck. 

#145452
Mar 04, 2016 1:04
Vote:
 

Hey mate,

The best way I found is to attached debugger and catch the exception and find the ContentID manually if those 4 tasks didn't help. Actually empty deleted content and then running service helps sometimes. I heared that the fix will be included in EPiServer.Find 11.1.2 (currently 11.1.1.4013). So if you can wait the release I belive will come soon.

Regards,

Aria

#145454
Mar 04, 2016 1:10
Vote:
 

Hey mate

Thanks for your quick response. 

Does VS allow you attach debugger to episerver find index job? 

Regards,

Vincent

#145455
Mar 04, 2016 1:28
Vote:
 

Yes.. Just attached debugger to IIS thread and re-index.

#145456
Mar 04, 2016 1:29
Vote:
 

Just give a try, but nothing happened :(

I am chating to epi support online right now. 

#145457
Mar 04, 2016 1:33
Vote:
 

Do you have resharper or something else that let you debug into their code?

#145458
Mar 04, 2016 1:36
Vote:
 

Just make sure you check the checkboxes for VS->Debug->Excpetion (VS2013) -> Common Language Runtime -> Both checkboxex (Thrown, User-Unhandled). Attach the debugger to IIS process (could be more than one). Adn then re-run the index. 

#145459
Mar 04, 2016 1:38
Vote:
 

I'm using dotPeek which is quite faster than anything else. You can setup it  via here https://confluence.jetbrains.com/display/NETCOM/dotPeek+Symbol+Server+and+PDB+Generation.

#145460
Mar 04, 2016 1:39
Vote:
 

The problem is in "EPiServer.Find.Cms.ContentIndexer.ReIndex()" if you search for 

"{0}: An exception occurred while indexing content {1]: {2} {3}"

you can find it. that "]" is wrong and need to be change to "}"! That is it! If you recompile and sign the DLL you can ready to go ;)

#145461
Mar 04, 2016 1:44
Vote:
 

Hi Guys....

Is there any update on this?....  I'm going to raise it as a bug again as I can't see it in the bug tracker and it hasn't been fixed as of EPiServer Find 11.1.2

I've obvioulsy a combination of content errors that triggers this exception, which then crashes and stops the indexer.....

2016-04-03 12:26:34,814 WARN [365] EPiServer.Find.Cms.ContentIndexer.ReIndex - SIMONWIN8: An exception occurred during reindex operation. System.AggregateException: One or more errors occurred. ---> System.FormatException: Input string was not in a correct format.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)
at EPiServer.Find.Cms.ContentIndexer.<>c__DisplayClass12.<ReIndex>b__9(IEnumerable`1 currentBatch, ParallelLoopState loopstate)
at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)
--- End of inner exception stack trace ---
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at System.Threading.Tasks.Parallel.PartitionerForEachWorker[TSource,TLocal](Partitioner`1 source, ParallelOptions parallelOptions, Action`1 simpleBody, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEachWorker[TSource,TLocal](IEnumerable`1 source, ParallelOptions parallelOptions, Action`1 body, Action`2 bodyWithState, Action`3 bodyWithStateAndIndex, Func`4 bodyWithStateAndLocal, Func`5 bodyWithEverything, Func`1 localInit, Action`1 localFinally)
at System.Threading.Tasks.Parallel.ForEach[TSource](IEnumerable`1 source, ParallelOptions parallelOptions, Action`2 body)
at EPiServer.Find.Cms.ContentIndexer.ReIndex(Action`1 statusAction, Func`1 isStopped)
---> (Inner Exception #0) System.FormatException: Input string was not in a correct format.
at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)
at EPiServer.Find.Cms.ContentIndexer.IndexBatch(IEnumerable`1 content, Action`1 statusAction, Int32& numberOfContentErrors, Int32& indexingCount)
at EPiServer.Find.Cms.ContentIndexer.<>c__DisplayClass12.<ReIndex>b__9(IEnumerable`1 currentBatch, ParallelLoopState loopstate)
at System.Threading.Tasks.Parallel.<>c__DisplayClass32`2.<PartitionerForEachWorker>b__30()
at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask)
at System.Threading.Tasks.Task.<>c__DisplayClass11.<ExecuteSelfReplicating>b__10(Object param0)<---

#147002
Apr 03, 2016 13:32
Vote:
 

This issue is still present in EPiServer Find 11.1.2 and I created a new bug #FIND-919 for this issue. The bug has been fixed by our product devs. It will then go through the QA process before releasing in nuget feed. For now you can follow its status through our public bug list http://world.episerver.com/support/bug-list/bug/FIND-919

#147040
Apr 05, 2016 6:16
Vote:
 

Had the same problem in:

EPiServer.Find.Cms, Version=11.1.3.4160

on in file EPiServer.Find.Cms.ContentIndexer.IndexBatch method there is line:

string format = "{0}: An exception occurred while indexing content {1]: {2} {3}";

that kills whole reindex job

will check later versions if they are fixed

#147779
Apr 25, 2016 15:36
Vote:
 

I can confirm that it is fixed in:

"EPiServer.Find.Cms" version="11.1.5.4342"

#147784
Apr 25, 2016 16:15
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.