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

Expose error when checking if alias exists #12886

Merged
merged 2 commits into from Jul 18, 2019

Conversation

cwurm
Copy link
Contributor

@cwurm cwurm commented Jul 12, 2019

We are using a HEAD /_alias/{alias} request to check if a particular alias exists during setup. If this request fails (e.g. because of missing privileges) we will not get the full error message from Elasticsearch telling us which privilege is missing. Changing to GET will get us that while maintaining functionality.

Before (when missing privileges):

2019-07-12T10:29:43.672+0100	ERROR	instance/beat.go:877	Exiting: failed to check for alias 'auditbeat-7.2.0': (status=403) : 403 Forbidden:
Exiting: failed to check for alias 'auditbeat-7.2.0': (status=403) : 403 Forbidden:

After:

Exiting: failed to check for alias 'auditbeat-8.0.0': (status=403) {"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/aliases/get] is unauthorized for user [auditbeat]"}],"type":"security_exception","reason":"action [indices:admin/aliases/get] is unauthorized for user [auditbeat]"},"status":403}: 403 Forbidden: {"error":{"root_cause":[{"type":"security_exception","reason":"action [indices:admin/aliases/get] is unauthorized for user [auditbeat]"}],"type":"security_exception","reason":"action [indices:admin/aliases/get] is unauthorized for user [auditbeat]"},"status":403}

Also seen in #10241 (comment).

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should have a changelog entry.

@cwurm cwurm force-pushed the ilm_exists_alias_expose_error branch from e8c46d8 to 2a75db1 Compare July 17, 2019 12:45
@cwurm cwurm merged commit 8ba2d18 into elastic:master Jul 18, 2019
@cwurm cwurm deleted the ilm_exists_alias_expose_error branch July 18, 2019 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants