You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 16, 2023. It is now read-only.
if http "/_cluster/health?{{ .Values.clusterHealthCheckParams }}" "--fail" ; then
with default value of clusterHealthCheckParams: "wait_for_status=green&timeout=1s", it will render to:
if curl -XGET -s -k --fail ${BASIC_AUTH} http://127.0.0.1:9200/_cluster/health?wait_for_status=green&timeout=1s ; then
Where the url is not enclosed in single quotes and since there is an ampersand in the command, it doesn't work.
Namely, Bash will run curl -XGET -s -k --fail ${BASIC_AUTH} http://127.0.0.1:9200/_cluster/health?wait_for_status=green in the background (because of the ampersand), then will run timeout=1s which is a valid bash operation and obviously, it will return 0 and the check passes even though the cluster is in RED state.
Suggested solution: The solution is easy, add single quotes to the url.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Chart version: 7.8.0
Short description: Readiness probe passes even when the cluster is in RED state because of bash syntax error
Long description:
In the readiness probe in chart/templates (https://github.com/elastic/helm-charts/blob/master/elasticsearch/templates/statefulset.yaml#L262), the check for readiness is:
if http "/_cluster/health?{{ .Values.clusterHealthCheckParams }}" "--fail" ; then
with default value of
clusterHealthCheckParams: "wait_for_status=green&timeout=1s"
, it will render to:if curl -XGET -s -k --fail ${BASIC_AUTH} http://127.0.0.1:9200/_cluster/health?wait_for_status=green&timeout=1s ; then
Where the url is not enclosed in single quotes and since there is an ampersand in the command, it doesn't work.
Namely, Bash will run
curl -XGET -s -k --fail ${BASIC_AUTH} http://127.0.0.1:9200/_cluster/health?wait_for_status=green
in the background (because of the ampersand), then will run timeout=1s which is a valid bash operation and obviously, it will return 0 and the check passes even though the cluster is in RED state.Suggested solution: The solution is easy, add single quotes to the url.
possibly related issues:
#215
#374
The text was updated successfully, but these errors were encountered: