The datasource with ID ... could not be retrieved for index

Created on 15 June 2021, over 3 years ago
Updated 29 May 2024, 7 months ago

Problem/Motivation

Seeing multiple error messages in watchdog while performing a search:
Drupal\search_api\SearchApiException: The datasource with ID '1oqsme--entity:node' could not be retrieved for index 'Global Search'. in Drupal\search_api\Entity\Index->getDatasource()
Everything seems to be working fine performing the search except for this error messages in the watchdog.

Steps to reproduce

This seems to happen if you use a Solr Server with setting "Retrieve result data from Solr" (retrieve_data).
(It is a scenario in which multiple Drupal instances use one solr core).
The "1oqsme" part of the datasource ID mentioned in the error is the hash of the instance in Solr.
It seems that Drupal cannot handle this datasource ID, because of the hash.

Proposed resolution

Skip "preLoadResultItems" in "preRender" if the Solr Server is configured as given above.

Remaining tasks

Provide a patch

🐛 Bug report
Status

Fixed

Version

4.2

Component

Code

Created by

🇩🇪Germany stefan.korn Jossgrund

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇬🇧United Kingdom 2dareis2do

    +1 #16

  • 🇧🇷Brazil cassioalmeida

    Hi everyone,

    I started to face this issue with a Solr server on Pantheon. The search view started to present some errors, for example, the header was showing "Listing 1-16 of 44 result(s)" - but in fact, it was listing 12 items (not 16). Another issue was that I typed a random string (knowing this should result in an empty response message), but I still got the header showing a random results number.

    Then, I saw the error in the logs and found this thread. The comment #16 🐛 The datasource with ID ... could not be retrieved for index Fixed fixed the issue.

  • 🇪🇸Spain Carlitus

    Some problem, same solution.

    Also i had weird results like @cassioalmeida.

    And after you check the option "Retrieve results for this site only" you have to delete and reindex items in the index.

Production build 0.71.5 2024