Description
Type of issue
None
What documentation page is affected
https://www.elastic.co/docs/reference/elasticsearch/command-line-tools/reconfigure-node
What happened?
If the enrollment script is ran on a node that does not have network access to the node it is attempting to enroll to, it will fail and not revert changes. The issue is there are edits made to the elasticsearch.yml file that are not undone. Upon failure it is leading to more downstream issues even if network connectivity is resolved.
Specifically, the error "Skipping security auto configuration because it appears that the node is not starting up for the first time. The node might already be part of a cluster and this auto setup utility is designed to configure Security for new clusters only., with exit code 80"
The reality is the node is not part of a cluster, it only failed attempting to join the cluster and edits were dropped during the attempt.
Improving the error handling by verifying connectivity to the initial node before making any file edits would resolve this issue. Failure to connect should return an error message stating that it cannot connect - this should also be checked and handled prior to editing the elasticsearch.yml file.
Currently this is causing customers to uninstall and restart the second node and numerous support tickets as it is not clear what the issue is and why after resolving connectivity the user cannot resume the install and has to start over.
Additional info
Please verify connectivity to enrollment node prior to modifying files as part of the enrollment script to prevent downstream issues.