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

Provide a hint to check the logs if the service does not start #61767

Closed
markwalkom opened this issue Sep 1, 2020 · 8 comments · Fixed by #75418
Closed

Provide a hint to check the logs if the service does not start #61767

markwalkom opened this issue Sep 1, 2020 · 8 comments · Fixed by #75418
Assignees
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team

Comments

@markwalkom
Copy link
Contributor

I have noticed an increase in users not able to start Elasticsearch after installation, and they are only providing the response from the service start command. Is it possible to have Elasticsearch return a message like "Please check your Elasticsearch logs for more information." to the output to give people a hint on what to do next. I feel that it'd help reduce a lot of friction and give users guidance.

Here's some recent topics where it would have helped;
https://discuss.elastic.co/t/elasticsearch-service-failed-to-start-on-centos/247034/
https://discuss.elastic.co/t/es-7-9-doesnt-start/246908
https://discuss.elastic.co/t/elastic-search-failed-to-start/246845

@markwalkom markwalkom added >enhancement needs:triage Requires assignment of a team area label labels Sep 1, 2020
@jloleysens jloleysens added the :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) label Sep 1, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (:Distributed/Allocation)

@elasticmachine elasticmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Sep 1, 2020
@jloleysens jloleysens added :Core/Infra/Core Core issues without another label and removed :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. labels Sep 1, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (:Core/Infra/Core)

@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Sep 1, 2020
@rjernst rjernst added :Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts and removed :Core/Infra/Core Core issues without another label needs:triage Requires assignment of a team area label labels Sep 1, 2020
@rjernst
Copy link
Member

rjernst commented Sep 1, 2020

This should be possible. I've marked this for discussion, but I believe this is a trivial change. We just need to write a message with the ES log path to stdout, which will get picked up by journald/systemd.

@jasontedor
Copy link
Member

Relates #47208.

@pugnascotia
Copy link
Contributor

We discussed it, and it seem entirely reasonable.

@pugnascotia pugnascotia self-assigned this Sep 9, 2020
@pugnascotia
Copy link
Contributor

So it turns out that we do try to print a pointer to the logs. We only do this if Elasticsearch managed to get as far as configuring logging, because there's no point in directing a user to the logs if ES can't have written anything to them.

However, we actually need more exception handling here since elasticsearch.main(...) only catches a couple of expected exception, and lets anything else propagate, and that stops us printing the log message.

@pugnascotia
Copy link
Contributor

Hmm, there's also ElasticsearchUncaughtExceptionHandler, which actually writes out the exception details to stderr. That may be a more natural place to add a pointer to the logs?

@rjernst
Copy link
Member

rjernst commented Sep 16, 2020

@pugnascotia It seems we have a bit of overlap between the uncaught exception handler, and the main method return you pointed to above. The uncaught exception handler directly exits, which causes us not to invoke the above. I wonder if we should consolidate these in some way (the exiting) so that when we are prepared to exit, we print the message pointing at the logs, and then use the halt mechanism uncaught exception handler uses now.

@mark-vieira mark-vieira added Team:Delivery Meta label for Delivery team and removed Team:Core/Infra Meta label for core/infra team labels Nov 11, 2020
pugnascotia added a commit that referenced this issue Jul 21, 2021
Closes #61767.

When Elasticsearch fails to start up, it tries to print a message to
suggest to the user that they consult the log for more information.
However, if a fatal error is encountered, Elasticsearch exits directly and
no such message is printed.

Improve this situation by printing the same message when Elasticsearch
is about to exit due to a fatal unexpected error.
pugnascotia added a commit that referenced this issue Jul 21, 2021
Closes #61767.

When Elasticsearch fails to start up, it tries to print a message to
suggest to the user that they consult the log for more information.
However, if a fatal error is encountered, Elasticsearch exits directly and
no such message is printed.

Improve this situation by printing the same message when Elasticsearch
is about to exit due to a fatal unexpected error.
ywangd pushed a commit to ywangd/elasticsearch that referenced this issue Jul 30, 2021
Closes elastic#61767.

When Elasticsearch fails to start up, it tries to print a message to
suggest to the user that they consult the log for more information.
However, if a fatal error is encountered, Elasticsearch exits directly and
no such message is printed.

Improve this situation by printing the same message when Elasticsearch
is about to exit due to a fatal unexpected error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Packaging RPM and deb packaging, tar and zip archives, shell and batch scripts >enhancement Team:Delivery Meta label for Delivery team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants