09 marzo, 2016
Recently we were working with Sitecore 8.0 Update 5 and our update package simply wouldn't install. We didn't see any exceptions in the logs, but we did see the following lines:
3180 15:53:29 WARN A duplicate setting "ContentSearch.SearchMaxResults" has been detected in the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file. The value of the setting will be changed to "500".
3180 15:53:29 WARN A duplicate setting "ContentSearch.DefaultIndexConfigurationPath" has been detected in the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config file. The value of the setting will be changed to "contentSearch/indexConfigurations/defaultSolrIndexConfiguration".
Some additional digging surfaced up this point from the Sitecore 8.0 Update 6 release notes:
A stack overflow exception might sometime occur during an update package or usual Sitecore package installation if Sitecore configuration contained definition of the same setting several times. This has been fixed. (440534, 448151) https://dev.sitecore.net/Downloads/Sitecore%20Experience%20Platform/8%200/
Sitecore%20Experience%20Platform%2080%20Update6/Release%20Notes
Reviewing the showconfig for our build, we were able to identify that as our original warnings suggested, the two configuration settings were indeed duplicated. The files that introduced the settings were:
- Sitecore.ContentSearch.config
- Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config
The obvious issue here was that instead of patching the settings created in Sitecore.ContentSearch.config, the Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config was actually adding a second copy of the settings. Looking at the Solr file we saw the following syntax for the two settings:
<setting name="ContentSearch.DefaultIndexConfigurationPath"
value="contentSearch/indexConfigurations/defaultSolrIndexConfiguration" />
<setting name="ContentSearch.SearchMaxResults" value="500" />
We edited the elements to use patching instead:
<setting name="ContentSearch.SearchMaxResults">
<patch:attribute name="value">500</patch:attribute>
</setting>
<setting name="ContentSearch.DefaultIndexConfigurationPath">
<patch:attribute name="value">contentSearch/indexConfigurations/defaultSolrIndexConfiguration</patch:attribute>
</setting>
With this change, the warning in the log files disappeared and the update installer returned to normal functioning.