Skip to content
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

[ElasticSearch] unable to build docker image without ES node #4912

Closed
insekticid opened this issue Sep 4, 2022 · 0 comments
Closed

[ElasticSearch] unable to build docker image without ES node #4912

insekticid opened this issue Sep 4, 2022 · 0 comments

Comments

@insekticid
Copy link
Contributor

insekticid commented Sep 4, 2022

When building docker image and using Elasticsearch mapping, composer run-script --no-dev post-install-cmd will trigger in php bin/console cache:clear and it will try to connect to ElasticSearch and get indexes, so docker build will end with: No alive nodes found in your cluster

in CI you do not have access to other services, so this is bad behaviour

!!  In StaticNoPingConnectionPool.php line 64:
!!
!!    [Elasticsearch\Common\Exceptions\NoNodesAvailableException]
!!    No alive nodes found in your cluster
!!
!!
!!  Exception trace:
!!    at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:64
!!   Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:82
!!   Elasticsearch\Transport->getConnection() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:99
!!   Elasticsearch\Transport->performRequest() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:297
!!   Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() at /var/www/html/vendor/react/promise/src/FulfilledPromise.php:28
!!   React\Promise\FulfilledPromise->then() at /var/www/html/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php:55
!!   GuzzleHttp\Ring\Future\CompletedFutureValue->then() at /var/www/html/vendor/ezimuel/ringphp/src/Core.php:341
!!   GuzzleHttp\Ring\Core::proxy() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:345
!!   Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:241
!!   Elasticsearch\Connections\Connection->performRequest() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php:110
!!   Elasticsearch\Transport->performRequest() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/AbstractNamespace.php:63
!!   Elasticsearch\Namespaces\AbstractNamespace->performRequest() at /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Namespaces/CatNamespace.php:210
!!   Elasticsearch\Namespaces\CatNamespace->indices() at /var/www/html/vendor/api-platform/core/src/Elasticsearch/Metadata/Resource/Factory/ElasticsearchProviderResourceMetadataCollectionFactory.php:92
!!   ApiPlatform\Elasticsearch\Metadata\Resource\Factory\ElasticsearchProviderResourceMetadataCollectionFactory->hasIndices() at /var/www/html/vendor/api-platform/core/src/Elasticsearch/Metadata/Resource/Factory/ElasticsearchProviderResourceMetadataCollectionFactory.php:49
!!   ApiPlatform\Elasticsearch\Metadata\Resource\Factory\ElasticsearchProviderResourceMetadataCollectionFactory->create() at /var/www/html/vendor/api-platform/core/src/Metadata/Resource/Factory/CachedResourceMetadataCollectionFactory.php:65
!!   ApiPlatform\Metadata\Resource\Factory\CachedResourceMetadataCollectionFactory->create() at /var/www/html/vendor/api-platform/core/src/Symfony/Routing/ApiLoader.php:79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant