0

Solr is accessible with https but not with http in my local.

What could be the reason ? Am i missing some configuration ?

ManagedPoolThread #1 11:53:35 WARN  Unable to connect to Solr: [http://localhost:8983/solr], the [SolrNet.Exceptions.SolrConnectionException] was caught.
Exception: SolrNet.Exceptions.SolrConnectionException
Message: The server committed a protocol violation. Section=ResponseStatusLine
Source: SolrNet
   at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters)
   at SolrNet.Impl.SolrCoreAdmin.Status()
   at Sitecore.ContentSearch.SolrProvider.SolrStatus.OkSolrStatus()

EDIT: Added updates from comments:

I verified following things-

  1. Below configs are enabled-

    Sitecore.ContentSearch.Solr.DefaultIndexConfiguration
    Sitecore.ContentSearch.Solr.Index.Core
    Sitecore.ContentSearch.Solr.Index.Master
    Sitecore.ContentSearch.Solr.Index.Web
    
  2. checked solr logs -- no errors.

  3. checked crawling logs - found error Unable to connect to Solr: [http://localhost:8983/solr]

  4. tried to access solr url over http its not accessible (localhost refused to connect.), however its accessible over https

  5. solr service is up.

5
  • Probably. We would need to see a lot of your configs to know. Did you check the basics? what have you investigated? did you read sitecore.stackexchange.com/questions/1245/… ?
    – Mark Cassidy
    Sep 30 '20 at 6:38
  • I verified following things- 1. Below configs are enabled- Sitecore.ContentSearch.Solr.DefaultIndexConfiguration Sitecore.ContentSearch.Solr.Index.Core Sitecore.ContentSearch.Solr.Index.Master Sitecore.ContentSearch.Solr.Index.Web 2. checked solr logs -- no errors. 3. checked crawling logs - found error Unable to connect to Solr: [localhost:8983/solr] 4. tried to access solr url over http its not accessible (localhost refused to connect.), however its accessible over https 5. solr service is up.
    – Siddharth
    Sep 30 '20 at 7:21
  • why do you need it to run on http, we only need it on https. Is there a case where you need it? Sep 30 '20 at 8:21
  • Using Sitecore. 8.2 (rev. 171121) - There is one instance where already its working on http so was thinking if this could be reason.
    – Siddharth
    Sep 30 '20 at 9:24
  • This particular Solr version is tricky, sometimes you have to stop Solr entirely, then stop Sitecore entirely and start Solr, and then Sitecore (viniciusdeschamps.com.br/sitecore-solr-is-not-starting-tricky-2). Give a shot and let us know Sep 30 '20 at 9:30
2

Go to config Sitecore.ContentSearch.Solr.DefaultIndexConfiguration.config (\App_Config\Sitecore\ContentSearch) and search for ContentSearch.Solr.ServiceBaseAddress setting and make it https://localhost:8983/solr

<setting name="ContentSearch.Solr.ServiceBaseAddress" value= "https://localhost:8983/solr" /> 
4
  • Unable to connect to Solr: [localhost:8983/solr], the [SolrNet.Exceptions.SolrConnectionException] was caught. Exception: SolrNet.Exceptions.SolrConnectionException Message: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. Source: SolrNet at SolrNet.Impl.SolrConnection.Get(String relativeUrl, IEnumerable`1 parameters) at SolrNet.Impl.SolrCoreAdmin.Status() at Sitecore.ContentSearch.SolrProvider Message: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    – Siddharth
    Sep 30 '20 at 10:16
  • @siddharth this case a problem that the certificate is not trusted. Add the certificate to the "Trusted Root Certification Authorities". Here you can find info how to do it: success.outsystems.com/Support/Enterprise_Customers/… Sep 30 '20 at 14:58
  • Thanks all. Instead of using solr as http, i followed below link and generated local ssl certificate for Solr. Now indexes are appearing. gist.github.com/kamsar/c3c8322c1ec40eac64c7dd546e5124de
    – Siddharth
    Sep 30 '20 at 18:10
  • @siddharth I don't understand how generating new cert worked.. Error message is showing that it's trying to connect over HTTP and not HTTPS. This solution can work when request was made to HTTPS and cert was not intalled in Trusted Root Cert Authority. Sep 30 '20 at 18:40
0

Solr does not support both HTTP and HTTPS at the same. You can only use one of them at a time.

So, make sure to update your config files(e.g. \App_Config\ConnectionStrings.config) to use only https://localhost:8983/solr.

4
  • configured as - <setting name="ContentSearch.Provider" value="Solr"/> <setting name="ContentSearch.Solr.ServiceBaseAddress" value= "localhost:8983/solr" />
    – Siddharth
    Sep 30 '20 at 9:46
  • make this entry as localhost:8983/solr and then check Sep 30 '20 at 9:58
  • ERROR Unable to connect to [localhost:8983/solr], Core: [social_messages_web] Exception: SolrNet.Exceptions.SolrConnectionException Message: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
    – Siddharth
    Sep 30 '20 at 10:37
  • Aha okay, I was under impression that you are using Sitecore 9. Sep 30 '20 at 18:40
0

My old instance was using solr-5.5.1, I was able to connect using http://localhost:8983/solr. However for my new instance , solr-6.6.2 is installed and I could not connect to it over http.

I followed below url to generate local ssl certificate for solr - https://gist.github.com/kamsar/c3c8322c1ec40eac64c7dd546e5124de.

Things to be taken care while following above url-

  1. Add path of keystore to environment variable. Added "C:\Program Files\Java\jre1.8.0_261\bin" to Path variable.
  2. Check and confirm path of solr-ssl.keystore.jks file in your machine - .\solrssl.ps1 -keystoreFile C:\solr\solr-6.6.2\server\etc\solr-ssl.keystore.jks

Still solr is not accessible with http://localhost:8983/solr, however after certification installation and using https://localhost:8983/solr , indexing manager start showing indexes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.