We're updating the issue view to help you get more done. 

Clarify the error message when the Elasticsearch cluster cannot be reached upon startup

Description

Of one starts Hibernate Search without the Elasticsearch cluster being reachable, we get something like this:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2019-06-17 10:34:42,919 ERROR [org.hib.sea.eng.rep.imp.RootFailureCollector] (main) HSEARCH000521: Hibernate Search bootstrap encountered a non-fatal failure; continuing bootstrap for now to list all mapping problems, but the bootstrap process will ultimately be aborted. Context: backend '_quarkus_' Failure:: org.hibernate.search.util.common.SearchException: HSEARCH400080: Failed to detect the Elasticsearch version running on the cluster. at org.hibernate.search.backend.elasticsearch.client.impl.ElasticsearchClientUtils.getElasticsearchVersion(ElasticsearchClientUtils.java:72) at org.hibernate.search.backend.elasticsearch.impl.ElasticsearchLinkImpl.onStart(ElasticsearchLinkImpl.java:92) at org.hibernate.search.backend.elasticsearch.impl.ElasticsearchBackendImpl.start(ElasticsearchBackendImpl.java:131) at org.hibernate.search.engine.common.impl.BackendPartialBuildState.finalizeBuild(BackendPartialBuildState.java:41) at org.hibernate.search.engine.common.impl.SearchIntegrationPartialBuildStateImpl.finalizeIntegration(SearchIntegrationPartialBuildStateImpl.java:99) at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.doBootSecondPhase(HibernateOrmIntegrationBooterImpl.java:241) at org.hibernate.search.mapper.orm.bootstrap.impl.HibernateOrmIntegrationBooterImpl.bootNow(HibernateOrmIntegrationBooterImpl.java:165) .... Caused by: org.hibernate.search.util.common.SearchException: HSEARCH400007: Elasticsearch request failed. Request: GET with parameters {} Response: null at org.hibernate.search.backend.elasticsearch.client.impl.ElasticsearchClientUtils.getElasticsearchVersion(ElasticsearchClientUtils.java:68) ... Caused by: [...] Connection refused

And then we get a bootstrap failure with a similar message.

Problems:

  1. The first log mentioning that we're "continuing bootstrap" is misleading, since most of the time we will not continue bootstrap, because there's only one backend and it failed to start. Not sure we can do much about this, but maybe we should have a look.

  2. The second exception mentioning the request and response is confusing, because it mentions a null response. We should probably format the message differently, or even remove it completely, when we failed to send the request.

  3. The actual message that will help users fix the problem is buried in the 2nd cause. It should be more visible.

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major