We have started to upgrade some of the Sitecore solutions to Sitecore 10.4. In the middle of the process, Sitecore released 10.4 Update 1 (Sitecore 10.4.1) which was really cool for us. This would have solved lot of our problems that we feared of when we started llike Solr 8 EOL, some nuget vulnerabilities, ….

But as with other things in life, everything has its pros and cons. Looks like that introducing Solr 9.8.1 together with this version of Sitecore, introduced also one new issue, not only solved some of Solr 8.x concerns…

Problem

Solr 9.8.1 cores have in default config set in NumFieldLimitingUpdateRequestProcessorFactory maxFields setting that is set to value 1000:

Sitecore is increasing this value to 2000 in sitecore-solr.json file:

Which is nice but as title of this article says, it is not enough. Our Sitecore log was flooded with these 400 HTTP STATUS exceptions:

Current core has 2837 fields, exceeding the max-fields limit of 2000

Full exception is at the end of the article.

Also Solr log was showing lots of these Client Exception exceptions:

Solution

Solution was pretty easy at the end.

You have two options:

#1 You need to increase the value for Solr.MaxFieldsValue variable under Variables section in sitecore-solr.json file to desired value based on exception. For me exception was mentioning 2837 so I have increased it to 3000. Then you need to uninstall and install Sitecore 10.4.1 instance once again…

#2 Change belowmentioned value for maxfields directly in core configuration under server\solr\*core_name*\conf\solrconfig.xml in highlighted xml node. After this change, you need to restart your Solr instance…

Full exception discovered in Sitecore log

ManagedPoolThread #3 11:17:56 INFO Job started: Index_Update_IndexName=sitecore_master_index
ManagedPoolThread #3 11:17:57 ERROR Exception
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
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.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain, Boolean failIfNotExists)
at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, String pipelineDomain)
at Sitecore.Jobs.DefaultJob.DoExecute()
at Sitecore.Abstractions.BaseJob.ThreadEntry(Object state)

Nested Exception

Exception: SolrNet.Exceptions.SolrConnectionException
Message:

400 0
org.apache.solr.common.SolrException org.apache.solr.common.SolrException
Current core has 2837 fields, exceeding the max-fields limit of 2000.
400

Source: SolrNet
at SolrNet.Impl.SolrConnection.PostStream(String relativeUrl, String contentType, Stream content, IEnumerable1 parameters) at SolrNet.Impl.SolrConnection.Post(String relativeUrl, String s) at SolrNet.Impl.LowLevelSolrServer.SendAndParseHeader(ISolrCommand cmd) at Sitecore.ContentSearch.SolrProvider.SolrFullBatchUpdateContext.Flush() at Sitecore.ContentSearch.SolrProvider.SolrFullBatchUpdateContext.Commit() at Sitecore.ContentSearch.AbstractSearchIndex.PerformUpdate(IEnumerable1 indexableInfo, IndexingOptions indexingOptions)

Nested Exception

Exception: System.Net.WebException
Message: The remote server returned an error: (400) Bad Request.
Source: System
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)