Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Readiness check doesn't wait for Green state #691

Closed
mtruneck opened this issue Jun 25, 2020 · 3 comments
Closed

Readiness check doesn't wait for Green state #691

mtruneck opened this issue Jun 25, 2020 · 3 comments
Labels
bug Something isn't working elasticsearch question Further information is requested triage/stale

Comments

@mtruneck
Copy link

mtruneck commented Jun 25, 2020

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

@fatmcgav
Copy link
Contributor

@mtruneck Thank-you for opening an issue.

Have you seen logs indicating that there is a quoting issue?

As the readinessProbe handling was reworked in #638 to solve a very similar issue, and now the curl command contains a double-quoted request URL:

curl --output /dev/null -k "$@" "{{ .Values.protocol }}://127.0.0.1:{{ .Values.httpPort }}${path}"

Are you able to provide the output from the following to help us investigate further:

  • helm get <deployment>
  • kubectl describe <elasticsearch pod>
  • kubectl get events

Cheers

@fatmcgav fatmcgav added bug Something isn't working elasticsearch question Further information is requested labels Jun 25, 2020
@botelastic
Copy link

botelastic bot commented Sep 23, 2020

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.

@botelastic
Copy link

botelastic bot commented Oct 23, 2020

This issue has been automatically closed because it has not had recent activity since being marked as stale.

@botelastic botelastic bot closed this as completed Oct 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working elasticsearch question Further information is requested triage/stale
Projects
None yet
Development

No branches or pull requests

2 participants