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

[BUG] SecurityAdmin tool uses incorrect http status code to handle error #5189

Open
yinl opened this issue Mar 18, 2025 · 0 comments
Open

[BUG] SecurityAdmin tool uses incorrect http status code to handle error #5189

yinl opened this issue Mar 18, 2025 · 0 comments
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized

Comments

@yinl
Copy link

yinl commented Mar 18, 2025

What is the bug?

s/whoAmIRes/res

if (replicaAutoExpand != null) {
                Settings indexSettings = Settings.builder()
                    .put("index.auto_expand_replicas", replicaAutoExpand ? "0-all" : "false")
                    .build();
                Response res = restHighLevelClient.getLowLevelClient()
                    .performRequest(new Request("PUT", "/_plugins/_security/configupdate?config_types=" + Joiner.on(",").join(getTypes())));
                if (res.getStatusLine().getStatusCode() != 200) {
                    System.out.println("Unable to reload configuration because return code was " + whoAmIRes.getStatusLine());
                    return (-1);
                }

How can one reproduce the bug?
reading SecurityAdmin.java, inner the branch of if (replicaAutoExpand != null)

What is the expected behavior?
print res的http status,not whoAmIRes

What is your host/environment?

  • OS: RHEL 7.2
  • Version [2.18.0]
  • Plugins

Do you have any screenshots?
No

Do you have any additional context?
No

@yinl yinl added bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized labels Mar 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged Require the attention of the repository maintainers and may need to be prioritized
Projects
None yet
Development

No branches or pull requests

1 participant