I've got a working solr server, however my drupal always fails to connect, what am I doing wrong?

When adding my server and clicking on the solr server url it takes me to my server (so my path is correct), yet I keep getting a message: The Solr server could not be reached.

I am hosting apache solr on a server (not locally).

  • Host: Server IP address

  • Port: 8983

  • Instance: /solr

Can anyone help me out ?

  • 1
    Can you connect to that server / port from your workstation using telnet? Can you do the same from the machine that hosts your Drupal? Do you see Welcome to Solr banner in response to GET /solr/? If answer is "no", you have hosting question, not Drupal one. – Mołot Nov 26 '13 at 13:21
  • I'm able to configure the solr server through ssh, I've copied the scheme.xml (and the other ones) from the search api module to my server, it all shows well on my control panel. I don't get why drupal is rejecting my connection. As for the machine hosting my drupal, I'll have to ask access to that server and test it, but from my work station I have no trouble at all. – Yassin Tahtah Nov 26 '13 at 13:23
  • 2
    I'm not asking if you can configure it. I'm asking if you can connect to it. It's not Drupal that rejects your connection, it's solr server that rejects Drupal's. And I doubt if it's caused by Drupal misconfiguration - could you verify this using telnet? Please put telnet outputs from both machines (http server machine and workstation) into question :) - without it no one can verify if it's Drupal. Unless you will make a dev environment of your Drupal on your workstation. – Mołot Nov 26 '13 at 13:25
  • It turned out to be that the server hosting drupal was unable to access the solr server because they were on different networks, you were right. Thanks a lot for helping me figure this out! – Yassin Tahtah Nov 26 '13 at 13:41

@see "Your site was unable to contact the Apache Solr server"

I follow this article https://www.lullabot.com/blog/article/installing-solr-use-drupal ,some day comes this errors after I reconfig of my site& apache. but I sloved like thisenter image description here

enter image description here


I was experiencing the same problem: Drupal 7.41 Tomcat 8 Solr 4.10.4

So my work around was: Step 1: Solr path config - enter :/solr/. This caused the SOLR and Drupal to be able to communicate.

However, the index fails because the URL cannot be used for the httpPost or httpGet. The following error will surface: SearchApiException while deleting items from server : "400" Status: HTTP method POST is not supported by this URL: HTTP method POST is not supported by this URL

Step 2: Remove '#/~cores/' The correct URI is the path listed in SOLR w/o the extra characters. Surprisingly, once I ran cron and restarted tomcat - the servers were still able to communicate and the index ran as designed.

NOTE: I had to delete the index configuration that failed and reconfigure AFTER making these changes. It seems there's some type of weird caching that 'remembers' the configuration ::shrug:::

Worked for me. And I hope it works for you. It took me a couple of hours to figure it out.



For some reason, in my case, the following string worked: /solr/#/drupal

So, the full URI:


In Solr Host field, you can try entering value: and for Solr path you can leave it empty.


I was experiencing this bug only when indexing. Which was making me think it's due to misconfiguration.

    Drupal\search_api\SearchApiException while trying to 
index items on index main: 
Solr endpoint https://mysite:443/solr/main/ unreachable

It turns out, this error can happen when it actually has reached the server, but you try to do something that throws an error in SOLR.

    [c:main s:shard2 r:core_main_node2 x:main] 
o.a.s.h.RequestHandlerBase org.apache.solr.common.SolrException: 
ERROR: [doc=mysite-main-entity:node/10:en] 
multiple values encountered for non multiValued 
field bs_mycustom_field: [true, true]

I was trying to add an array to a boolean in my custom processor!

It had worked previously but something changed where it was less forgiving.

I changed from this:

$mycustomfield->addValue(($data_item['status'] === "1"));

to this:

$mycustomfield->setValues([$data_item['status'] === "1"]);

in my custom SearchApiProcessor plugin (Drupal 8), then it indexed without issue.

The big takeaway here is, this error can be misleading! It did reach SOLR!

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.