I am encountering an error when adding a facet to my Drupal Search API Decoupled endpoint. The error message is:
LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\Core\Cache\CacheableJsonResponse. in Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (line 154 of core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).
This issue seems to be related to the handling of cache metadata in the facet module within the Search API Decoupled endpoint. The error does not occur in my local environment (without access to the Solr index and it returns no results) but manifests when using an Acquia Search API Solr server in the development environment.
Locally the facets return as expected, I don't have any results but I can see the facet in the facets array
{
"search_results": [],
"search_results_per_page": 10,
"search_results_count": 0,
"search_results_page": 0,
"search_results_pages": 0,
"facets": [
{
"label": "Knowledge Type",
"key": "facet_knowledge_type",
"count": 0,
"active_values": [],
"results": []
}
],
"took": 1152.55,
"max_score": 0
}
Be on Drupal 10.1.8 with the following other module versions:
Not sure
Not sure
N/A
Not sure
N/A
Active
1.0
Facets
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
No activities found.