AWS ElasticSearch complains about missing discovered_master

Created on 23 April 2020, over 4 years ago
Updated 26 June 2024, 6 months ago

After creating an AWS ElasticSearch instance and hitting the endpoint from my Drupal module, I get an error message when visiting the cluster info page:

Notice: Undefined index: discovered_master in Drupal\elasticsearch_connector\Controller\ElasticsearchController->getInfo() (line 180 of modules/contrib/elasticsearch_connector/src/Controller/ElasticsearchController.php).
Drupal\elasticsearch_connector\Controller\ElasticsearchController->getInfo(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 694)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I've added a patch that adds a "Discovered master" row to the Cluster Health table for review.

🐛 Bug report
Status

RTBC

Component

Code

Created by

🇦🇺Australia jaydee1818 Melbourne

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.

  • 🇪🇸Spain fjgarlin

    I am running into this issue and the suggested patch completely fixes it.

    Before patch
    Remote instance with AWS:

    After patch
    Remote instance with AWS:

    I also tried on a local non-AWS instance that does not offer that health status property to make sure that there were no regressions and it works well as well:

    Marking this RTBC.

Production build 0.71.5 2024