Problem/Motivation

The module always expects a $response['hits'] raw response in \Drupal\elasticsearch_search_api\Search\ElasticSearchResultParser::parse(...)

In case ES server is down or in an error state and it throws an error response rendering fails ugly...

Steps to reproduce

Remove your index on a running setup or simulate another error response from your ES server

Proposed resolution

Make the response parsing more robust and show proper notification without crashing with a WSOD.

Remaining tasks

Fix the code mentioned above and search for other related parsing elsewhere.

User interface changes

none

API changes

none

Data model changes

none

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lorenzs created an issue. See original summary.

lorenzs’s picture

Assigned: Unassigned » lorenzs

lorenzs’s picture

Added error handling in above MR. ES and backend services / repositories keep throwing errors as-is, the (Base) Controller will handle them (in search/filter/suggest) and render proper error notification instead of WSOD.

lorenzs’s picture

Assigned: lorenzs » Unassigned
Status: Active » Needs review
matthew.hallsworth’s picture

I'm going to setup a testbed to test this patch today and get back to you @lorenzs

Stay tuned :)

robindh made their first commit to this issue’s fork.

lorenzs’s picture

Status: Needs review » Reviewed & tested by the community

After feedback on MR tested in 2 different sites implementing the module. Exceptions result in proper feedback and if all is good everythings works as before (tested with search, filter and suggest - with/without ajax).

matthew.hallsworth’s picture

@lorenzs I've tested this in two local dev setup, with normal setup and your patch

Both scenarios when removing index returns proper feedback and all works as expected. Happy to push this on also

robindh’s picture

Thanks for the feedback @matthew.hallsworth.dpc

I've tested this on my local umami demo setup after merge request changes - still works as expected. RTBC +1

  • robindh committed 40471b1 on 2.0.x authored by lorenzs
    Issue #3319682: Module fails on rendering on ES error response
    
robindh’s picture

Status: Reviewed & tested by the community » Fixed
lorenzs’s picture

Issue tags: +VDAB-open-sprint-22

Status: Fixed » Closed (fixed)

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