Server not connecting with 2.1.1 release and Search API Solr 4.2.10

Created on 31 March 2023, over 1 year ago
Updated 5 June 2023, over 1 year ago

Versions

Drupal Core: 9.5.7
Search API Solr: 4.2.10
Search API Opensolr: 2.1.1
OpenSolr Core Type:
OpenSolr Core Version & Country: Solr Version: 8 us-east

Problem/Motivation

After the upgrade to 2.1.1 the server is throwing an error and is "Unavailable". This happens during the `$ping_server = $connector->pingServer();` call and the exception is this:

Solr endpoint https://us-east-8-11-2.solrcluster.com:443/ bad request (code: 400, body: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at us-east-8-11-2.solrcluster.com Port 443</address>
</body></html>
, message: Solr HTTP error: OK (400)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>400 Bad Request</title>
</head><body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<br />
</p>
<hr>
<address>Apache/2.4.29 (Ubuntu) Server at us-east-8-11-2.solrcluster.com Port 443</address>
</body></html>
).

Steps to reproduce

Visit the server page in the admin, observe the 'The Solr server could not be reached or is protected by your service provider.' message

I traced it back to the removal of the pingServer function in OpensolrSolrConnector, but not sure if this was intentional or what. For now I'm going to downgrade back to 2.1.0

  /**
   * {@inheritdoc}
   */
  public function pingServer() {
    return $this->pingCore();
  }
🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇺🇸United States nsciacca

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @nsciacca
  • 🇷🇴Romania bbu23

    Hello and thank you for reporting this issue.

    I'd like to confirm that the pingServer change was intentional, because there were changes on the opensolr side.
    I tested the US EAST index and cluster with Drupal 9.5.7 and Drupal 10.0.3, Search API Solr 4.2.10 and Search API Opensolr 2.1.1, and they both work properly.

    I cannot reproduce the error, therefore I'll have to mark this as postponed until I get more information, assuming that you are using the "Opensolr with Basic Auth (recommended)" Solr Connector and the Security in Opensolr is allowing the correct IPs or all.

  • Status changed to Postponed: needs info over 1 year ago
  • Status changed to Active over 1 year ago
  • 🇮🇳India manojbisht_drupal

    Hello,

    I am also facing same issue,
    For Server Connection it is saying, The Solr server could not be reached or is protected by your service provider. I am using "OpenSolr with Basic auth", and security in OpenSolr is allowing for all IPS. However, my core is reachable, and I am able to index the content, but this message is showing on admin page, and status of server is showing as "Unavailable".

  • Status changed to Postponed: needs info over 1 year ago
  • 🇷🇴Romania bbu23

    Reducing the priority as this is affecting only the ping, the rest of the functionality is working properly. As I said before, I cannot reproduce this, I tried on both Drupal 9 and Drupal 10, both indexes and clusters, so at the moment there's nothing I can do unless we get more info. Based on my tests, the admin page works as expected.

    As for the resolution of this, I will require more information to understand why some of you are getting this error.
    Please open a ticket here: https://opensolr.freshdesk.com/support/login, or send an email to support@opensolr.com with the OpenSolr account email and the affected Index Name so that we can look into it there. Please also mention in the subject the following string: [opesolr#3351611].

    Thanks

  • 🇺🇸United States mekal

    We are experiencing the same issue. I emailed opensolr like you said, but here is a little more info in case it helps.

    Drupal 9.5.7
    Search API Solr 4.2.10
    Search API Opensolr 2.1.1
    Solr Version: 8 us-east

    I noticed the ping request is going to https://us-east-8-11.solrcluster.com:443/solr/admin/info/system?wt=json&...
    and is resulting in a 400 Bad request, like nsciacca reported.

    If I add the pingServer() function back though, it works.
    It ends up calling the pingEndpoint() function instead of getServerInfo(), which ends up calling an endpoint that's specific to our index (HCFWebsite):
    https://us-east-8-11.solrcluster.com:443/solr/HCFWebsite/admin/ping?omit...

  • Status changed to Active over 1 year ago
  • 🇷🇴Romania bbu23

    Thank you for contacting opensolr support, we now have more information about the requests that are failing. We're going to provide a fix.

  • @bbu23 opened merge request.
  • Status changed to Needs review over 1 year ago
  • 🇷🇴Romania bbu23

    Please apply the following patch: https://git.drupalcode.org/project/search_api_opensolr/-/merge_requests/...

    I kindly ask everyone that is experiencing this issue to report back if it's working. I'm going to keep this issue open for a while until enough feedback is received, and then I'll create a new release.

    Thanks everyone!

  • 🇺🇸United States mekal

    The patch is working for us, thanks!

  • 🇺🇸United States nsciacca

    I can no longer reproduce the error. I updated back to 2.1.1 and it's connecting fine, even without the patch added. Strange, but I think this is good to go.

  • 🇷🇴Romania bbu23

    Well, the issue is that some servers are restricting access to the server admin info, this is why I couldn't reproduce the issue. Maybe your server got changed temporarily, and that's why you are not getting the error anymore. I expect that opensolr will restrict all if not most servers, so you should probably apply the patch anyways just in case it changes on the opensolr part. Thanks.

    • bbu23 committed 9e3528bb on 2.1.x
      Issue #3351611: Server not connecting with 2.1.1 release and Search API...
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024