This blog post is for you if you find the following warnings in Sitecore logs:
[Index=<indexname>] Crawling Paused
[Index=<indexname>] Synchronous Indexing Strategy is disabled while indexing is paused.
IndexingStateSwitcher: Indexing is not resumed since indexes have not been initialized yet…
Exception: SolrNet.Exceptions.SolrConnectionException, Message: Unable to connect to the remote server
You can see from these log messages that something is really not right with Solr or SolrCloud.
What happened in my case:
- Sitecore could not reach our SolrCloud
- After the second try Sitecore paused indexing for each indexes
- After Sitecore could reach our SolrCloud again, it tried to initialize the indexes but it failed for one index because of a wrong configuration (typo in the core name)
- Because of the failure of one index, Sitecore kept the indexing paused
How did I diagnose this? I implemented a small Razor view where I asked the following things from Sitecore:
- Current status of Solr connection
- Last status of Solr connection which saved
- Get Solr indexes and their IsInitialized property
- If an index is IsInitialized=false, then tried to initialize
|Solr Status: @SolrStatus.OkSolrStatus()|
|Solr Last Status: @typeof(IndexingStateSwitcher).GetField("lastSolrConnectionStatus", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.FlattenHierarchy).GetValue(null)|
|@foreach (AbstractSearchIndex index in ContentSearchManager.Indexes)|
I copied this file to the production CM server (it does not cause an application restart) to the sitecore/admin folder and then called the <domain>/sitecore/admin/solr-diagnostic.cshtml.
Don’t forget to delete this file after you are done with the diagnose!