Don't build suggesters if disabled

Created on 9 October 2023, 9 months ago
Updated 1 November 2023, 8 months ago

Setup

  • Solr version: 8.11.2
  • Drupal Core version: 10.1.5
  • Search API version: 8.x-1.29
  • Search API Solr version: 4.3.0
  • Configured Solr Connector: Standard

Issue

Every time the site's cron runs (via drush) the following error is logged:

Drupal\search_api_solr\SearchApiSolrException while maintaining Solr server Solr: Solr endpoint http://localhost:8983/ internal Solr server error (code: 0, body: , message: Solr HTTP error: HTTP request failed, Operation timed out after 5000 milliseconds with 0 bytes received). in Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase->handleHttpException() (line 1089 of web/modules/contrib/search_api_solr/src/SolrConnector/SolrConnectorPluginBase.php).

πŸ› Bug report
Status

Fixed

Version

4.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

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

Comments & Activities

  • Issue created by @DamienMcKenna
  • Assigned to DamienMcKenna
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Now that I've worked out the problem comes during cron execution I can start debugging it.

  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    You need to check the Solr logs.

    You can also increase the timeout on the server edit page in Drupal.

  • πŸ‡³πŸ‡±Netherlands Steven Buteneers

    I'm also experiencing this problem since updating from V4.2 to V4.3 together with updating from Drupal 9 to 10. It only appears on cron, regular indexing works like it's supposed to work.

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    FWIW I'm seeing this on a Pantheon site, so I don't have access to the Solr logs.

  • πŸ‡³πŸ‡±Netherlands Steven Buteneers

    These are the logs generated in SOLR at the same time as the error occurs:

    2023-10-30 13:30:03.086 INFO (qtp1548081008-23) [ x:shared] o.a.s.c.S.Request [shared] webapp=/solr path=/select params={q=*:*&json.facet={"maxVersion":"max(_version_)"}&json.nl=flat&omitHeader=false&fl=*,score&start=0&rows=1&wt=json} hits=6220 status=0 QTime=1
    2023-10-30 13:30:11.020 INFO (qtp1548081008-20) [ x:shared] o.a.s.c.S.Request [shared] webapp=/solr path=/select params={q=*:*&json.facet={"maxVersion":"max(_version_)"}&json.nl=flat&omitHeader=false&fl=*,score&start=0&rows=1&wt=json} hits=6220 status=0 QTime=0
    2023-10-30 13:30:25.445 INFO (qtp1548081008-22) [ x:shared] o.a.s.c.S.Request [shared] webapp=/solr path=/select params={q=*:*&json.facet={"maxVersion":"max(_version_)"}&json.nl=flat&omitHeader=false&fl=*,score&start=0&rows=1&wt=json} hits=6220 status=0 QTime=0
    2023-10-30 13:30:25.519 INFO (qtp1548081008-22) [ x:drupal] o.a.s.c.S.Request [drupal] webapp=/solr path=/select params={q=*:*&json.facet={"maxVersion":"max(_version_)"}&json.nl=flat&omitHeader=false&fl=*,score&start=0&rows=1&wt=json} hits=36731 status=0 QTime=2
    2023-10-30 13:30:25.606 INFO (qtp1548081008-22) [ x:drupal] o.a.s.h.c.SuggestComponent SuggestComponent prepare with : json.nl=flat&omitHeader=true&suggest.build=false&suggest.count=10&suggest.reload=false&suggest=true&suggest.buildAll=true&suggest.dictionary=und&wt=json&rid=-1664
    2023-10-30 13:30:25.606 INFO (qtp1548081008-22) [ x:drupal] o.a.s.s.s.SolrSuggester SolrSuggester.build(und)
    2023-10-30 13:30:30.712 INFO (qtp1548081008-22) [ x:drupal] o.a.s.s.s.SolrSuggester SolrSuggester.build(nl)
    2023-10-30 13:30:35.476 INFO (qtp1548081008-22) [ x:drupal] o.a.s.h.c.SuggestComponent SuggestComponent process with : json.nl=flat&omitHeader=true&suggest.build=false&suggest.count=10&suggest.reload=false&suggest=true&suggest.buildAll=true&suggest.dictionary=und&wt=json&rid=-1664
    2023-10-30 13:30:35.476 INFO (qtp1548081008-22) [ x:drupal] o.a.s.c.S.Request [drupal] webapp=/solr path=/suggest params={json.nl=flat&omitHeader=true&suggest.build=false&suggest.reload=false&suggest=true&suggest.buildAll=true&wt=json} status=0 QTime=9870

  • πŸ‡³πŸ‡±Netherlands Steven Buteneers

    Increasing the query and index timeouts from 5 to 10 seconds seems to "resolve" this

  • πŸ‡§πŸ‡ͺBelgium rp7

    I can confirm that increasing the query timeout resolves the error.

    Additionally, I think this cron-logic needs to be expanded to first see if the suggest request handler is enabled. You can disable it through the UI, but doing so will result in 404 Solr endpoint errors in the logs (when this cron is run).

  • Assigned to mkalkbrenner
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ

    A provider like pantheon could block or disable the suggester request handler.
    In this case you should also disable it via Search API Solr's UI.
    This patch then "solves" the issue.

  • Status changed to Needs review 8 months ago
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 10.1.x + Environment: PHP 8.1 & MySQL 8
    last update 8 months ago
    Patch Failed to Apply
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • Status changed to Fixed 8 months ago
  • πŸ‡©πŸ‡ͺGermany mkalkbrenner πŸ‡©πŸ‡ͺ
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Thanks for working out a fix for that!

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

Production build 0.69.0 2024