NoNodesAvailableException when trying to create initial index for fulltextseach, even though I can access ES via curl

Not sure if topic support / docker is correct or it should be installation or fulltextsearch. This is a question as suggested by daita on the github issue [Elasticsearch\Common\Exceptions\NoNodesAvailableException] 路 Issue #256 路 nextcloud/fulltextsearch 路 GitHub

I have nextcloud, postgres, elastic search and only office document server running each in their docker container, sharing one docker network. Nextcloud, postgres and only office can communicate, the last piece in the puzzle missing is elastic search.

When I try to create the initial index using

docker exec nextcloud su -l www-data -s /bin/sh -c "php -d memory_limit=10G -f /var/www/html/occ fulltextsearch:index -v"

Then I see the following output:

indexing.


  [Elasticsearch\Common\Exceptions\NoNodesAvailableException]
  No alive nodes found in your cluster


Exception trace:
 () at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:51
 Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:76
 Elasticsearch\Transport->getConnection() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:94
 Elasticsearch\Transport->performRequest() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:246
 Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/react/promise/src/FulfilledPromise.php:25
 React\Promise\FulfilledPromise->then() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/ringphp/src/Future/CompletedFutureValue.php:55
 GuzzleHttp\Ring\Future\CompletedFutureValue->then() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/guzzlehttp/ringphp/src/Core.php:341
 GuzzleHttp\Ring\Core::proxy() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:299
 Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:177
 Elasticsearch\Connections\Connection->performRequest() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:110
 Elasticsearch\Transport->performRequest() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/BooleanRequestWrapper.php:38
 Elasticsearch\Namespaces\BooleanRequestWrapper::performRequest() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/IndicesNamespace.php:38
 Elasticsearch\Namespaces\IndicesNamespace->exists() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/lib/Service/IndexService.php:70
 OCA\FullTextSearch_ElasticSearch\Service\IndexService->initializeIndex() at /var/www/html/custom_apps/fulltextsearch_elasticsearch/lib/Platform/ElasticSearchPlatform.php:170
 OCA\FullTextSearch_ElasticSearch\Platform\ElasticSearchPlatform->initializeIndex() at /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php:138
 OCA\FullTextSearch\Command\Index->indexProvider() at /var/www/html/custom_apps/fulltextsearch/lib/Command/Index.php:119
 OCA\FullTextSearch\Command\Index->execute() at /var/www/html/3rdparty/symfony/console/Command/Command.php:256
 Symfony\Component\Console\Command\Command->run() at /var/www/html/core/Command/Base.php:161
 OC\Core\Command\Base->run() at /var/www/html/3rdparty/symfony/console/Application.php:818
 Symfony\Component\Console\Application->doRunCommand() at /var/www/html/3rdparty/symfony/console/Application.php:186
 Symfony\Component\Console\Application->doRun() at /var/www/html/3rdparty/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at /var/www/html/lib/private/Console/Application.php:170
 OC\Console\Application->run() at /var/www/html/console.php:100
 require_once() at /var/www/html/occ:11

fulltextsearch:index [--output [OUTPUT]]

However, when I try to access elastic search from that container using curl it works:

docker exec nextcloud su -l www-data -s /bin/sh -c "curl http://nextcloud_elastic_search:9200/_cat/indices"

gives me the following response:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    65  100    65    0     0   2713      0 --:--:-- --:--:-- --:--:--  2826
yellow open nextcloud vx65wH-GTFKX32l0vvuz7w 5 1 0 0 1.2kb 1.2kb

I created the nextcloud index manually, I didn鈥檛 install readonlyrest, because my elastic search instance doesn鈥檛 expose the port outside of the docker container on a machine which itself isn鈥檛 directly publicly accessible.

Below you can see a screenshot of the full text search admin configuration.

I鈥檓 really puzzled as to what could be wrong, since I couldn鈥檛 find any additional logs what so ever.

I even tried enabling readonlyrest but also that didn鈥檛 seem to help

I鈥檓 using the following docker images:

  • nextcloud:12.0.5
  • docker.elastic.co/elasticsearch/elasticsearch:6.1.2

any ideas?