Skip to content

master_not_discovered_exception results in the following fatal error: #977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
JTubex opened this issue Nov 29, 2019 · 0 comments · Fixed by #980
Closed

master_not_discovered_exception results in the following fatal error: #977

JTubex opened this issue Nov 29, 2019 · 0 comments · Fixed by #980

Comments

@JTubex
Copy link

JTubex commented Nov 29, 2019

Summary of problem

master_not_discovered_exception results in the following fatal error:

Error: Wrong parameters for Elasticsearch\Common\Exceptions\ServerErrorResponseException([string $message [, long $code [, Throwable $previous = NULL]]]) in Exception->__construct() (line 704 of /vagrant/htdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php).
Exception->__construct(Array, 503, Object) (Line: 704)
Elasticsearch\Connections\Connection->tryDeserializeError(Array, 'Elasticsearch\Common\Exceptions\ServerErrorResponseException') (Line: 675)
Elasticsearch\Connections\Connection->tryDeserialize500Error(Array) (Line: 643)
Elasticsearch\Connections\Connection->process5xxError(Array, Array, Array) (Line: 315)
Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array) (Line: 25)
React\Promise\FulfilledPromise->then(Object, NULL, NULL) (Line: 55)
GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object, NULL, NULL) (Line: 341)
GuzzleHttp\Ring\Core::proxy(Object, Object) (Line: 324)
Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array, Object, Object, Array) (Line: 222)
Elasticsearch\Connections\Connection->performRequest('GET', '/_cluster/health', Array, NULL, Array, Object) (Line: 105)
Elasticsearch\Transport->performRequest('GET', '/_cluster/health', Array, NULL, Array) (Line: 58)
Elasticsearch\Namespaces\AbstractNamespace->performRequest(Object) (Line: 87)
Elasticsearch\Namespaces\ClusterNamespace->health() (Line: 112)
nodespark\DESConnector\Client->isClusterOk() (Line: 149)
Drupal\elasticsearch_connector\Controller\ClusterListBuilder->buildRow(Object) (Line: 262)
Drupal\elasticsearch_connector\Controller\ClusterListBuilder->render() (Line: 23)
Drupal\Core\Entity\Controller\EntityListController->listing('elasticsearch_cluster')
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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)

Code snippet of problem

Problem occurs in Elasticsearch\Connections\Connection::tryDeserializeError().

a print_r of the $response variable:

Array ( [transfer_stats] => Array ( [url] => http://localhost/_cluster/health [content_type] => application/json; charset=UTF-8 [http_code] => 503 [header_size] => 104 [request_size] => 215 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 30.010349 [namelookup_time] => 0.004242 [connect_time] => 0.004286 [pretransfer_time] => 0.004303 [size_upload] => 0 [size_download] => 151 [speed_download] => 5 [speed_upload] => 0 [download_content_length] => 151 [upload_content_length] => -1 [starttransfer_time] => 30.010292 [redirect_time] => 0 [redirect_url] => [primary_ip] => ::1 [certinfo] => Array ( ) [primary_port] => 9200 [local_ip] => ::1 [local_port] => 37072 [http_version] => 2 [protocol] => 1 [ssl_verifyresult] => 0 [scheme] => HTTP [error] => [errno] => 0 ) [curl] => Array ( [error] => [errno] => 0 ) [effective_url] => http://localhost/_cluster/health [headers] => Array ( [content-type] => Array ( [0] => application/json; charset=UTF-8 ) [content-length] => Array ( [0] => 151 ) ) [version] => 1.1 [status] => 503 [reason] => Service Unavailable [body] => {"error":{"root_cause":[{"type":"master_not_discovered_exception","reason":null}],"type":"master_not_discovered_exception","reason":null},"status":503} )

After $error = $this->serializer->deserialize($response['body'], $response['transfer_stats']);

this results in the following $error variable:
Array ( [error] => Array ( [root_cause] => Array ( [0] => Array ( [type] => master_not_discovered_exception [reason] => ) ) [type] => master_not_discovered_exception [reason] => ) [status] => 503 )

System details

  • Operating System: Debian 9 (Vagrant)
  • PHP Version: 7.3.11
  • ES-PHP client version: 7.4.1
  • Elasticsearch version: 7.4.2
oogFranz added a commit to oogFranz/elasticsearch-php that referenced this issue Dec 3, 2019
oogFranz added a commit to oogFranz/elasticsearch-php that referenced this issue Dec 3, 2019
ezimuel added a commit to oogFranz/elasticsearch-php that referenced this issue Dec 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant