-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(quickstart): elasticsearch-setup script fails on curl #5975
fix(quickstart): elasticsearch-setup script fails on curl #5975
Conversation
4ed7116
to
445732e
Compare
POLICY_RESPONSE_CODE=$(curl -o /dev/null -s -w "%{http_code}" --header "$ELASTICSEARCH_AUTH_HEADER" "$ELASTICSEARCH_INSECURE" "$ELASTICSEARCH_PROTOCOL://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/_ilm/policy/${PREFIX}datahub_usage_event_policy") | ||
echo -e "Create datahub_usage_event if needed against Elasticsearch at $ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT" | ||
echo -e "Going to use index prefix:$PREFIX:" | ||
POLICY_RESPONSE_CODE=$(curl -o /dev/null -s -w "%{http_code}" --header "$ELASTICSEARCH_AUTH_HEADER" "${ELASTICSEARCH_INSECURE}$ELASTICSEARCH_PROTOCOL://$ELASTICSEARCH_HOST:$ELASTICSEARCH_PORT/_ilm/policy/${PREFIX}datahub_usage_event_policy") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious -- Why is all of the new __STATUS stuff required?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
found the real problem... fixed up the PR
We're getting this failure when upgrading to Looks like |
* refactor(elasticsearch-setup-job): create-indices.sh readability The script contains many copy-pasting and is not easy to follow. Add comments, extract commonly used operations into functions, unify approaches. * fix(elasticsearch-setup-job): AWS indices creation Fix the issue where Amazon OpenSearch (AWS ES) indices are incorrectly initialised and the Analytics screen shows errors only. * feat(elasticsearch-setup-job): configuration hint mention USE_AWS_ELASTICSEARCH env value if it seems it's set the wrong way * fix(elasticsearch-setup-job): silent curl * fix(elasticsearch-setup-job): better USE_AWS_ELASTICSEARCH hint * docs(elasticsearch-setup-job): index dropping explained - more comments - more defensive approach - index file renamed * fix(elasticsearch-setup-job): script fixes * merge(elasticsearch-setup-job): merging in PR #5937 * merge(elasticsearch-setup-job): merging in PR #5963 * merge(elasticsearch-setup-job): merging in PR #5975 Co-authored-by: Pedro Silva <[email protected]>
PR #5887 caused a failure in the elasticsearch-setup script when insecure mode is not used, due to a sneaky bug.
This PR fixes this by re-attaching the ELASTICSEARCH_INSECURE flag to the beginning of the url
"${ELASTICSEARCH_INSECURE}$ELASTICSEARCH_PROTOCOL://..."
a better fix would probably be to refactor the CURL_OPTS into a separate variable that adds the
-k
flag if needed.Would like to get this PR in first to limit the refactor.
Tested locally by building the docker image and verifying that a clean quickstart now completes cleanly with es-indexes set up correctly.
Checklist