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] Invalid username or password when multi-tenancy is disabled #29

Closed
51CGO opened this issue Feb 16, 2023 · 5 comments
Closed

[BUG] Invalid username or password when multi-tenancy is disabled #29

51CGO opened this issue Feb 16, 2023 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@51CGO
Copy link

51CGO commented Feb 16, 2023

reporting-cli fails when multi-tenancy is disabled as it tries to reach the tenant selection page

Steps to reproduce:

  • In opensearch_dashboards.yml, set multitenancy_enabled: false
  • try to download a report with reporting-cli
    => Invalid username or password
@51CGO 51CGO added bug Something isn't working untriaged labels Feb 16, 2023
@rupal-bq
Copy link
Contributor

HI @51CGO,

Thank you for reporting this issue. Will look into it.

@rupal-bq rupal-bq self-assigned this Feb 16, 2023
@51CGO
Copy link
Author

51CGO commented Feb 17, 2023

Thank you.

It should be easy to fix:
To make it work for my configuration, I commented the following code:

try {
if (tenant === 'global' || tenant === 'private') {
await page.click('label[for=' + tenant + ']');
} else {
await page.click('label[for="custom"]');
await page.click('button[data-test-subj="comboBoxToggleListButton"]');
await page.type('input[data-test-subj="comboBoxSearchInput"]', tenant);
}
}
catch (err) {
spinner.fail('Invalid username or password');
exit(1);
}

await page.waitForTimeout(5000);
await page.click('button[data-test-subj="confirm"]');
await page.waitForTimeout(25000);
await overridePage.goto(url, { waitUntil: 'networkidle0' });
await overridePage.waitForTimeout(5000);
// Check if tenant was selected successfully.
if ((await overridePage.$('button[data-test-subj="confirm"]')) !== null) {
spinner.fail('Invalid tenant');
exit(1);
}

Adding a parameter "--multitenancy=false" and surrounding the above code with "if multitenancy ... then ..." should do the job.

@rupal-bq
Copy link
Contributor

@51CGO Thank you for the analysis. Feel free to open PR if you would like.

@brijos
Copy link

brijos commented Feb 22, 2023

@51CGO It looks like you have the solution. Are you interested in submitting a PR? We are always looking for external contributions to the project.

@51CGO
Copy link
Author

51CGO commented Feb 23, 2023

@rupal-bq @brijos I'm sorry. This is not a language I know enough to make good code and all the checks needed. I was only able to see were the issue came from but I can't make all the reuired fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants