February 16, 2021

Dipsy Kapoor

|

2 min. read

While reviewing tuning suggestions for a customer using cluster Solr 8.1.1 deployments with Sitecore 9.3, we found evidence of a Solr bug that is causing intermittent 401 errors when Basic Authentication is enabled. If you are experiencing this issue, we are recommending an upgrade to Solr 8.2.

What’s the Issue with Intermittent 401 Errors?

Cluster Solr 8.1.1 deployments with Basic Authentication enabled may have intermittent failures during inter-node communication during indexing. The result is that the requests fail with 401 errors.

This issue has been previously reported as SOLR-13510 on the Apache Solr Issues webpage.

If your Solr deployment is facing this issue, you will see errors messages similar to the one shown below:

2019-06-04 07:31:00.227 ERROR (qtp67730604-24) [c:gettingstarted s:shard1 r:core_node3 x:gettingstarted_shard1_replica_n1] o.a.s.h.RequestHandlerBase org.apache.solr.client. solrj.impl.BaseHttpSolrClient$RemoteSolrException: Error from server at null: Expected mime type application/octet-stream but got text/html.

				
					<html>
<head>

<title>Error 401 require authentication</title>
</head>
<body><h2>HTTP ERROR 401</h2>
<p>Problem accessing /solr/gettingstarted_shard3_replica_n4/select. Reason:
<pre> require authentication</pre></p>
<script>class RocketElementorAnimation{constructor(){this.deviceMode=document.createElement("span"),this.deviceMode.id="elementor-device-mode-wpr",this.deviceMode.setAttribute("class","elementor-screen-only"),document.body.appendChild(this.deviceMode)}_detectAnimations(){let t=getComputedStyle(this.deviceMode,":after").content.replace(/"/g,"");this.animationSettingKeys=this._listAnimationSettingsKeys(t),document.querySelectorAll(".elementor-invisible[data-settings]").forEach(t=>{const e=t.getBoundingClientRect();if(e.bottom>=0&&e.top<=window.innerHeight)try{this._animateElement(t)}catch(t){}})}_animateElement(t){const e=JSON.parse(t.dataset.settings),i=e._animation_delay||e.animation_delay||0,n=e[this.animationSettingKeys.find(t=>e[t])];if("none"===n)return void t.classList.remove("elementor-invisible");t.classList.remove(n),this.currentAnimation&&t.classList.remove(this.currentAnimation),this.currentAnimation=n;let s=setTimeout(()=>{t.classList.remove("elementor-invisible"),t.classList.add("animated",n),this._removeAnimationSettings(t,e)},i);window.addEventListener("rocket-startLoading",function(){clearTimeout(s)})}_listAnimationSettingsKeys(t="mobile"){const e=[""];switch(t){case"mobile":e.unshift("_mobile");case"tablet":e.unshift("_tablet");case"desktop":e.unshift("_desktop")}const i=[];return["animation","_animation"].forEach(t=>{e.forEach(e=>{i.push(t+e)})}),i}_removeAnimationSettings(t,e){this._listAnimationSettingsKeys().forEach(t=>delete e[t]),t.dataset.settings=JSON.stringify(e)}static run(){const t=new RocketElementorAnimation;requestAnimationFrame(t._detectAnimations.bind(t))}}document.addEventListener("DOMContentLoaded",RocketElementorAnimation.run);</script></body>
</html>
				
			
				
					at org.apache.solr.client.solrj.impl.Http2SolrClient.processErrorsAndResponse (Http2SolrClient.java:681) at org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:400) at org.apache.solr.client.solrj.impl.Http2SolrClient.request(Http2SolrClient.java:739) at org.apache.solr.client.solrj.SolrClient.request(SolrClient.java:1274) at org.apache.solr.handler.component.HttpShardHandler.request(HttpShardHandler.java:227) at org.apache.solr.handler.component.HttpShardHandler.lambda$submit$0 (HttpShardHandler.java:188) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.codahale.metrics.InstrumentedExecutorService$InstrumentedRunnable.run (InstrumentedExecutorService.java:181) at org.apache.solr.common.util.ExecutorUtil$MDCAwareThreadPoolExecutor.lambda$execute$0 (ExecutorUtil.java:209) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:834)
				
			

We Recommend an Upgrade to Solr 8.2 for Sitecore 9.3

If you are receiving intermittent 401 errors in Solr 8.1.1 deployments with Sitecore 9.3 and have implemented Basic Authentication, we recommend an upgrade to Solr 8.2. While Solr 8.1.1 is the currently recommended version for Sitecore 9.3, our team is working with Sitecore on this issue to establish broader support for Sitecore 9.3 and Solr 8.2.

Please submit a Support Ticket through the Managed Solr Dashboard if you have any additional questions. If you are experiencing any other Solr performances issues on Sitecore, check out our blog post with 5 ways to Optimize Solr Search Performance.

By Dipsy Kapoor

VP, Engineering

“…search should not only be for those organizations with massive search budgets.”

Get the Latest Content First