I started searching the issues for 'Solr endpoint unreachable or returned unexpected response code "0"' and discovered this one, but in my case I'm having a different experience. Although the Solr server can be reached and the Solr core could be accessed (latency: 269.03490884399 ms), I'm nevertheless getting this error when I index content. I'm not sure how to debug this, whether the issue is with the module or elsewhere. I'm opening this ticket hoping to attract others who may be experiencing the same.

CommentFileSizeAuthor
#8 3109599.patch1.52 KBmkalkbrenner

Comments

stephenplatz created an issue. See original summary.

mkalkbrenner’s picture

Check the Solr log files.

minoroffense’s picture

I'm getting something similar. Says the server is there, indexing seems to work but that message appears. And searches don't work. In my case the logs say something about the ping request triggering an exception:

org.apache.solr.common.SolrException: Unknown RequestHandler (qt): null
	at org.apache.solr.handler.PingRequestHandler.handlePing(PingRequestHandler.java:244)
	at org.apache.solr.handler.PingRequestHandler.handleRequestBody(PingRequestHandler.java:214)
mkalkbrenner’s picture

The qt param seems to be missing int the query string. Can you enable search_api_solr_devel to get a dump of the query that gets generated and post it here?

minoroffense’s picture

Here's one of them. There are some other errors.

I have another solr cloud instance that works with this site so I'm trying to figure out why that one is different.

Try to send Solr request => admin/ping?omitHeader=true&wt=json&json.nl=flat
GET => Array
(
    [omitHeader] => Array
        (
            [0] => true
        )

    [wt] => Array
        (
            [0] => json
        )

    [json.nl] => Array
        (
            [0] => flat
        )

)
Received Solr response => 400 OK
minoroffense’s picture

Here's another specifically for a select request

Try to send Solr request => select?distrib=true&omitHeader=true&wt=json&json.nl=flat&q=%2A%3A%2A&start=0&rows=1&fl=id&fq=%2Bhash%3A%2A+%2Bindex_id%3A%2A&json.facet=%7B%22maxVersion%22%3A%22max%28_version_%29%22%2C%22siteHashes%22%3A%7B%22field%22%3A%22hash%22%2C%22limit%22%3A-1%2C%22type%22%3A%22terms%22%2C%22facet%22%3A%7B%22indexes%22%3A%7B%22field%22%3A%22index_id%22%2C%22limit%22%3A-1%2C%22type%22%3A%22terms%22%2C%22facet%22%3A%7B%22dataSources%22%3A%7B%22field%22%3A%22ss_search_api_datasource%22%2C%22limit%22%3A-1%2C%22type%22%3A%22terms%22%2C%22facet%22%3A%7B%22maxVersionPerDataSource%22%3A%22max%28_version_%29%22%7D%7D%7D%7D%7D%7D%7D
GET => Array
(
    [distrib] => Array
        (
            [0] => true
        )

    [omitHeader] => Array
        (
            [0] => true
        )

    [wt] => Array
        (
            [0] => json
        )

    [json.nl] => Array
        (
            [0] => flat
        )

    [q] => Array
        (
            [0] => *:*
        )

    [start] => Array
        (
            [0] => 0
        )

    [rows] => Array
        (
            [0] => 1
        )

    [fl] => Array
        (
            [0] => id
        )

    [fq] => Array
        (
            [0] => +hash:* +index_id:*
        )

    [json.facet] => Array
        (
            [0] => {"maxVersion":"max(_version_)","siteHashes":{"field":"hash","limit":-1,"type":"terms","facet":{"indexes":{"field":"index_id","limit":-1,"type":"terms","facet":{"dataSources":{"field":"ss_search_api_datasource","limit":-1,"type":"terms","facet":{"maxVersionPerDataSource":"max(_version_)"}}}}}}}
        )

)
Received Solr response => 404 OK
mkalkbrenner’s picture

Category: Bug report » Support request

Obvoiously aou use the Solr Cloud connector. Are you really running Solr in Cloud mode?
Is it a local installation or do you leverage a Solr service provider?

mkalkbrenner’s picture

Category: Support request » Feature request
Status: Active » Needs review
StatusFileSize
new1.52 KB

Here's a little patch that "might" improve the error message to give a hint.

  • mkalkbrenner committed 584fcfb on 8.x-3.x
    Issue #3109599 by mkalkbrenner: Solr endpoint unreachable or returned...
  • mkalkbrenner committed 84dec23 on 8.x-3.x
    Issue #3109599 by mkalkbrenner: Solr endpoint unreachable or returned...
mkalkbrenner’s picture

Status: Needs review » Fixed
minoroffense’s picture

Cool thanks. Actually I was doing some debugging. I think what happened in my case was when I tried to generate the configs, Drupal failed to ask solr what version it was and so it generated solr 6 conf and tried to deploy it. Solr took that in and a partially functional collection was created. But then searches wouldn't work.

I had to change the code to default to solr 7 so the auto detect wouldn't override on a ping failure.

Once I got a good config it started working properly.

I'm not sure how I got it into this state in the first place where Drupal couldn't detect the version. I have to deploy this to a few more environments soon enough and if I run into this again I'll provide steps to reproduce.

minoroffense’s picture

Just to clarify our CI pipeline process takes the generated config and ships it to solr automatically. Drupal isn't doing that on its own.

mkalkbrenner’s picture

You could specify the Solr major version explicitly in the admin UI. In addition you can force a specific version instead the autodection when you you run the drush command to create the config-set. It is documented in INSTALL.md:

2. Download the config.zip from the server's details page or by using
drush solr-gsc with proper options, for example for a server named
"my_solr_server": drush solr-gsc my_solr_server config.zip 8.4.

stephenplatz’s picture

I'm still having issues, after applying the patch I'm getting Error: Wrong parameters for Drupal\search_api_solr\SearchApiSolrException([string $message [, long $code [, Throwable $previous = NULL]]]) in Exception->__construct() (line 893 of /app/web/modules/contrib/search_api_solr/src/SolrConnector/SolrConnectorPluginBase.php). Looking at solr_gc.log.0.current, solr.log, and the most current request.log, I'm just not seeing anything that looks strange, to my eye. But, I'm not able to index more than 50 items, and sometimes not even that, with the same message as before (without the patch) Drupal\search_api_solr\SearchApiSolrException while trying to index items on index solr_index: Solr endpoint unreachable or returned unexpected response code "0". in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->indexItems() (line 979 of /search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php)

stephenplatz’s picture

Status: Fixed » Needs work
stephenplatz’s picture

Category: Feature request » Support request
mkalkbrenner’s picture

Status: Needs work » Fixed

Yes, the patch contained an typo. The second commit fixed that before 3.9 was released.

stephenplatz’s picture

OK, thanks, that's helpful, I had missed the update. I (probably) know that the issue is at least on the server now with Drupal\search_api_solr\SearchApiSolrException while trying to index items on index solr_index: Solr endpoint internal Solr server error (0). in Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend->indexItems() (line 998 of /app/web/modules/contrib/search_api_solr/src/Plugin/search_api/backend/SearchApiSolrBackend.php). I'm not seeing any obvious errors in the server logs, but I'll do some research to see if I can pick out some clues.

edit I think my issue is still one of module configuration, adjusting the timeout settings for basic auth connections seems to have resolved some of the error messages and allowed the content to be indexed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

lakshmi_a’s picture

When i am searching data using autocomplete i am getting error.

Drupal\search_api_solr\SearchApiSolrException: Solr endpoint http://10.98.101.118:8983/ not found (404). Error 404 Not Found

HTTP ERROR 404

Problem accessing /solr/meme_core/autocomplete. Reason:

 Not Found

in Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase->handleHttpException() (line 998 of /var/www/html/meme/meme_qa_migration/modules/contrib/search_api_solr/src/SolrConnector/SolrConnectorPluginBase.php)

Please suggest e