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

0301 optimize boot failure logs #10052

Merged
merged 3 commits into from Mar 6, 2023

Conversation

zmstone
Copy link
Member

@zmstone zmstone commented Mar 1, 2023

Fixes EMQX-9052

Improve daemon mode startup failure logs.

Before this change, it was difficult for users to understand the reason for EMQX 'start' command failed to boot the node.
The only information they received was that the node did not start within the expected time frame,
and they were instructed to boot the node with 'console' command in the hope of obtaining some logs.
However, the node might actually be running, which could cause 'console' mode to fail for a different reason.

With this new change, when daemon mode fails to boot, a diagnosis is issued. Here are the possible scenarios:

  • If the node cannot be found from ps -ef, the user is instructed to find information in log files erlang.log.*.
  • If the node is found to be running but not responding to pings, the user is advised to check if the host name is resolvable and reachable.
  • If the node is responding to pings, but the EMQX app is not running, it is likely a bug. In this case, the user is advised to report a Github issue.

PR Checklist

Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:

  • Added tests for the changes
  • Changed lines covered in coverage report
  • Change log has been added to changes/{ce,ee}/(feat|perf|fix)-<PR-id>.en.md and .zh.md files
  • For internal contributor: there is a jira ticket to track this change
  • [~] If there should be document changes, a PR to emqx-docs.git is sent, or a jira ticket is created to follow up
  • [~] Schema changes are backward compatible

@zmstone zmstone requested review from a team and Rory-Z as code owners March 1, 2023 19:47
Rory-Z
Rory-Z previously approved these changes Mar 2, 2023
bin/emqx Outdated Show resolved Hide resolved
bin/emqx Show resolved Hide resolved
changes/ce/fix-10052.zh.md Outdated Show resolved Hide resolved
thalesmg
thalesmg previously approved these changes Mar 2, 2023
apps/emqx_machine/src/emqx_machine.erl Outdated Show resolved Hide resolved
bin/emqx Show resolved Hide resolved
bin/emqx Outdated Show resolved Hide resolved
@zmstone zmstone dismissed stale reviews from thalesmg and Rory-Z via 5c7d936 March 2, 2023 13:32
@zmstone zmstone force-pushed the 0301-optimize-boot-error-log branch from aa45e59 to 5c7d936 Compare March 2, 2023 13:32
Prior to this change, when EMQX daemon mode failed to start
it's not quite easy for users to understand what went wrong.
All the know is the node did not start in time
and then instructed to boot the node in 'console' mode wishing
for some logs.
However, the node might actuay be running, causing 'console' mode
to fail with a different reason.

With this change, after a filure of daemon mode boot,
we issue a diagnosis.
1. if node can not be found from ps -ef, instruct the user
   to find information in erlang.log.N
2. if the node is found running, but not responding to pings
   instruct the user to check if the node name is
   resolvable and reachable
3. if the node is responding to pings but emqx app is not
   running, then it's likely a bug. so the user is advised
   to report a github issue.
@zmstone zmstone force-pushed the 0301-optimize-boot-error-log branch from 5c7d936 to 4eb9a69 Compare March 2, 2023 13:50
@zmstone zmstone merged commit a4aece3 into emqx:master Mar 6, 2023
@zmstone zmstone deleted the 0301-optimize-boot-error-log branch March 6, 2023 07:32
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 this pull request may close these issues.

None yet

4 participants