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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|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!
2 thoughts on “Diagnose Solr connectivity issues on production”
This is exactly what I’ve observed in my own environment. It’s initialising indexes that I no longer need. Would you by chance know how I can disbable initialisation of those indexes or disable them all together? I haven’t been able to find a definitive guide and Sitecore support doesn’t seem too helpful either.
This is great