SOLR

[Fixed] #Sitecore RebuildSearchIndex|System.IO.IOException: Cannot overwrite

Posted on Updated on

Issue: Cannot overwrite index during quick search index rebuild via Sitecore Control panel .

Job started: RebuildSearchIndex|System.IO.IOException: Cannot overwrite: D:\SITECORE\data\indexes\__system\_b.fdt
at Lucene.Net.Store.FSDirectory.InitOutput(String name)
at Lucene.Net.Store.SimpleFSDirectory.CreateOutput(String name)
at Lucene.Net.Index.FieldsWriter..ctor(Directory d, String segment, FieldInfos fn)
at Lucene.Net.Index.StoredFieldsWriter.InitFieldsWriter()
at Lucene.Net.Index.StoredFieldsWriter.FinishDocument(PerDoc perDoc)
at Lucene.Net.Index.DocumentsWriter.WaitQueue.WriteDocument(DocWriter doc)
at Lucene.Net.Index.DocumentsWriter.WaitQueue.Add(DocWriter doc)
at Lucene.Net.Index.DocumentsWriter.FinishDocument(DocumentsWriterThreadState perThread, DocWriter docWriter)
at Lucene.Net.Index.DocumentsWriter.UpdateDocument(Document doc, Analyzer analyzer, Term delTerm)
at Lucene.Net.Index.IndexWriter.AddDocument(Document doc, Analyzer analyzer)
at Sitecore.Search.IndexUpdateContext.AddDocument(Document document)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Index.Rebuild()
at Sitecore.Shell.Applications.Search.RebuildSearchIndex.RebuildSearchIndexForm.Builder.Build()|Job ended: RebuildSearchIndex (units processed: )

 

Rebuild_Quick_Search_Index_cannot_overide

Solution: The file is corrupted, so just delete the file, in my case “_b.fdt”.

Quick_Search_Indexes_file

.. and rebuild again.

Rebuild_Quick_Search_counting.png

 

Enjoy. ūüôā

Advertisements

[Fixed] RebuildSearchIndex|System.ArgumentException: it doesn’t make sense to have a field that is neither indexed nor stored.

Posted on

Whilst rebuilding the quick search indexes in the control panel, I’ve encountered the issue below:

Job started: RebuildSearchIndex|System.ArgumentException: it doesn’t make sense to have a field that is neither indexed nor stored
at Lucene.Net.Documents.Field..ctor(String name, Boolean internName, String value_Renamed, Store store, Index index, TermVector termVector)
at Sitecore.Search.Crawlers.BaseCrawler.CreateDataField(String name, String value)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddSpecialFields(Document document, Item item)
at Sitecore.Search.Crawlers.DatabaseCrawler.IndexVersion(Item item, Item latestVersion, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddItem(Item item, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Crawlers.DatabaseCrawler.AddTree(Item root, IndexUpdateContext context)
at Sitecore.Search.Index.Rebuild()
at Sitecore.Shell.Applications.Search.RebuildSearchIndex.RebuildSearchIndexForm.Builder.Build()|Job ended: RebuildSearchIndex (units processed: 39449)

it doesnt make sense to have a field that is neither index.png

Solution:

Find the items with the greater length than 120 and rename those items in Sitecore content editor.

SELECT [ID]
,[Name]
,[TemplateID]
,[MasterID]
,[ParentID]
,[Created]
,[Updated]
FROM [dbo].[Items]
WHERE LEN([NAME]) > 120

Note: 100 is the default MAX item length specified in web.config.

Check_item_name_length_greater_than_120.png

Thanks to this post by Chaturanga ranatunga

Alternatively, if the result is too many, then you might want to increase the value of the setting MaxItemNameLength to 200 in the \Website\web.config instead.

<setting name="MaxTreeDepth" value="20" />
<!-- MAX ITEM NAME
Specifies the maximum length of an item name.
Default value: 100
-->
<setting name="MaxItemNameLength" value="1000" />

Remember: Please do not forget to revert back the value if needed.

[Fixed] RebuildSearchIndex|System.Threading.LockRecursionException: Recursive read lock acquisitions not allowed in this mode.

Posted on Updated on

While rebuilding the Search Indexes.

Issue:

Job started: RebuildSearchIndex|System.Threading.LockRecursionException: Recursive read lock acquisitions not allowed in this mode.
at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
at System.Threading.ReaderWriterLockSlim.TryEnterReadLock(TimeoutTracker timeout)
at System.Threading.ReaderWriterLockSlim.TryEnterReadLock(Int32 millisecondsTimeout)
at Sitecore.Search.IndexUpdateContext..ctor(ILuceneIndex index)
at Sitecore.Search.Index.Rebuild()
at Sitecore.Shell.Applications.Search.RebuildSearchIndex.RebuildSearchIndexForm.Builder.Build()|Job ended: RebuildSearchIndex (units processed: )

Screenshot:

Rebuild_Search_Indexes

Solution:

In the Sitecore.Forms.config, there’s a settings:


<!-- CONNECTION STRING
Sets the name of the connection string
-->
<setting name="WFM.ConnectionString" value="reporting" />

Make sure that it is equivalent in the connectionstring.config WFFM connectionstring.


<add name="reporting" connectionString="Data Source=11.2.3.456,1433;Database=sitecore_analytics;Integrated Security=true" /> 

Working rebuild index.JPG

[Fixed] Index_Update_IndexName=genericsearch_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation

Posted on Updated on

Issue:

 Job started: Index_Update_IndexName=genericsearch_master_index|#Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---&gt; SolrNet.Exceptions.SolrConnectionException: &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;response&gt;
&lt;lst name=&quot;responseHeader&quot;&gt;&lt;int name=&quot;status&quot;&gt;400&lt;/int&gt;&lt;int name=&quot;QTime&quot;&gt;0&lt;/int&gt;&lt;/lst&gt;&lt;lst name=&quot;error&quot;&gt;&lt;lst name=&quot;metadata&quot;&gt;&lt;str name=&quot;error-class&quot;&gt;org.apache.solr.common.SolrException&lt;/str&gt;&lt;str name=&quot;root-error-class&quot;&gt;org.apache.solr.common.SolrException&lt;/str&gt;&lt;/lst&gt;&lt;str name=&quot;msg&quot;&gt;ERROR: [doc=sitecore://master/{5ff1f382-cae2-4c69-907a-06410e3afb9f}?lang=en&amp;amp;ver=1&amp;amp;ndx=genericsearch_master_index] unknown field 'searchfacet_computed'&lt;/str&gt;&lt;int name=&quot;code&quot;&gt;400&lt;/int&gt;&lt;/lst&gt;
&lt;/response&gt;
---&gt; System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()
at SolrNet.Impl.SolrConnection.GetResponse(IHttpWebRequest request)
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
--- End of inner exception stack trace ---
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable`1 parameters)
at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s)
at SolrNet.Impl.SolrBasicServer`1.SendAndParseHeader(ISolrCommand cmd)
at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.AddRange(IEnumerable`1 group, Int32 groupSize)
at Sitecore.ContentSearch.SolrProvider.SolrBatchUpdateContext.Commit()
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.PerformRebuild(Boolean resetIndex, Boolean optimizeOnComplete, IndexingOptions indexingOptions, CancellationToken cancellationToken)
at Sitecore.ContentSearch.SolrProvider.SolrSearchIndex.Rebuild(Boolean resetIndex, Boolean optimizeOnComplete)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Sitecore.Reflection.ReflectionUtil.InvokeMethod(MethodInfo method, Object[] parameters, Object obj)
at Sitecore.Jobs.JobRunner.RunMethod(JobArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Jobs.Job.ThreadEntry(Object state)

Solution:

Head to SOLR admin page – http://127.0.0.1:8983/solr, and refresh index that’s throwing¬†an error exception; so in my case genericsearch_master_index.

reload_solr_index

Test again, it should work now.

rebuilding_index_using_indexing_manager

 

Update 14.08.2016 : If the above steps failed. Double check the schema, and see if it’s the latest version and/or has the right settings on it.

Fixed: Value cannot be null, Parameter name: fieldNameTranslator

Posted on Updated on

In this post, I’m going to tackle an¬†error¬†I encountered previously during my¬†upgrade execution¬†to v.8.1 Update-2.¬†There were various discussions over the internet¬†related to this common issue, so if the fix I’m going to provide shortly didn’t resolve your issue, I encourage you to take a look at these blogs / posts, as well.

  1. Getting error on Content Editor after upgrading to Sitecore 8, here
  2. Error in contenttestingupdate.aspx while performing a Sitecore upgrade, here
  3. Content Search rebuild index error, here
  4. Resolved Sitecore SOLR provider error, here

If you have a blog post, that tackles the same issue with different approach / suggestions from the above links, please feel free to comment below so I can add it also in the list.

Value cannot be null Parameter name fieldNametranslator

I faced this issue when configuring SOLR as my search provider in my local instance – migrated from the production instance of one of my clients.

My scenario:

  1. I log-in to Sitecore, and the dashboard page loaded properly
  2. I navigated to Desktop interface, and it loads properly as well.
  3. I navigated to Content Editor, and it throw the above error.

Upon checking on my configurations, I missed to disabled every single file that has ‘Lucene’ on¬†its file name. I did, but it’s still showing the same error.

I compared the DLLs of Content Search and Castle Windsor Рin this case my IOC, and they were not assembly identical. So, I replaced all the DLLs from a freshly installed instance Рin this case v.8.1 Update-2, but the issue keeps showing.

Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.dll

Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.dll - assembly discrepancy.png

Sitecore.ContentSearch.SolrProvider.dll

Sitecore.ContentSearch.SolrProvider.dll - assembly discrepancy.png

The above were just two (2) out of many file version discrepancies I had encountered.

When you upgrade to a particular Sitecore Platform version, in the Sitecore Experience Platform page (eg. v.8.1 Update-2), there is a SOLR Support package you should use to overwrite the existing assemblies you have in your bin folder.

Sitecore - SORL Support Package dlls

 

Warning: You don’t need all of these DLLs. In my case, I used Castle Windsor as my IOC. So¬†what I only need are:

  1. Castle.Facilities.SolrNetIntegration.dll
  2. Microsoft.Practices.ServiceLocation.dll
  3. Sitecore.ContentSearch.Linq.Solr.dll
  4. Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.dll
  5. Sitecore.ContentSearch.SolrProvider.dll
  6. SolrNet.dll
  7. StructureMap.SolrNetIntegration.dll

The Sitecore Search Scaling Guide is an essential documentation that explained the files you only need in a particular IOC implementation. You can read the chapter 3.3.1, but I would just paste it here to make it more easier for you.

Sitecore Scaling Guide - Selecting the Correct Support DLL files.JPG

Lastly, I altered the Global.asax file.

From: 

Inherits="Sitecore.Web.Application"... 

To:

Inherits="Sitecore.ContentSearch.SolrProvider.CastleWindsorIntegration.WindsorApplication"...

I tried it again, and the Content editor loads properly now.