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] Default route causes "could not locate that dashboard" error #1678

Open
reformit opened this issue Nov 29, 2023 · 1 comment
Open

[BUG] Default route causes "could not locate that dashboard" error #1678

reformit opened this issue Nov 29, 2023 · 1 comment
Labels
bug Something isn't working triaged

Comments

@reformit
Copy link

reformit commented Nov 29, 2023

What is the bug?
Default route results in "could not locate that dashboard" Error after login when current tenant doesn't match the default tenant.

How can one reproduce the bug?

  1. docker-compose up
services:
  opensearch:
    image: opensearchproject/opensearch:2.11.0
    container_name: opensearch
    environment:
      - discovery.type=single-node
      - bootstrap.memory_lock=true
    ports:
      - 9200:9200
      - 9600:9600
    networks:
      - opensearch-net

  dashboard:
    image: opensearchproject/opensearch-dashboards:2.11.0
    container_name: dashboard
    ports:
      - 5601:5601
    expose:
      - "5601"
    environment:
      OPENSEARCH_HOSTS: '["https://opensearch:9200"]'
    networks:
      - opensearch-net

networks:
  opensearch-net:
  1. Use API to add an index and index data

2a. Run create index CURL command

{
    "settings": {
        "number_of_shards": 1
    },
    "mappings": {
        "properties": {
            "field1": { "type": "text" },
            "field2": { "type": "integer" }
            // Add other fields as needed
        }
    }
}'

2b. Run add index data CURL command

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/1" -H 'Content-Type: application/json' -d '
{
    "field1": "value1",
    "field2": 123
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/2" -H 'Content-Type: application/json' -d '
{
    "field1": "value2",
    "field2": 1234
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/3" -H 'Content-Type: application/json' -d '
{
    "field1": "value3",
    "field2": 12345
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/4" -H 'Content-Type: application/json' -d '
{
    "field1": "value4",
    "field2": 123456
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/5" -H 'Content-Type: application/json' -d '
{
    "field1": "value5",
    "field2": 1234567
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/6" -H 'Content-Type: application/json' -d '
{
    "field1": "value6",
    "field2": 12345678
}'

curl -XPUT   --insecure -u admin:admin "https://localhost:9200/test_index/_doc/7" -H 'Content-Type: application/json' -d '
{
    "field1": "value7",
    "field2": 123456789
}'
  1. Login with admin admin and choose private tenant for default

  2. Management -> Security -> Tenants

  3. click "Create Tenant", name it test-tenant and click "Create" button

  4. go to Dashboards

  5. Create an index pattern for test*

  6. Go to Dashboards and click "Create new dashboard"

  7. in the section where it says add a new object to the dashboard click the "Create new" button and create some visualization (I used Gauge) and save the visualization and the dashboard. I named them gauge1 and dashboard1.

  8. click Dashboards and r-click on the title that says "dashboard1" and copy the link address.

  9. Go to "Dashboard Management" -> "Advanced settings"

  10. Past the copied link in the Default route from /app here's an example from my environment of the value used to configure the default route:

/app/dashboards#/view/7c955fd0-8ed0-11ee-ad75-21445a360a8f
  1. Click the "Save Changes" button that is displayed at the bottom of the screen.

  2. Logout & Log back in it does not display the Dashboard it only displays if you logout and then log back in again.

  3. from the users profile icon in the upper right switch to the test-tenant" and follow the same steps to create a dashboard and visualization. When you logout and log back in it does not redirect to the dashboard and displays an error that it can't find the dashboard.

If you go to Security -> Tenants and make the test-tenant the default tenant (make sure it's also the "Current" tenant) logout and log back in it redirects as expected to the dashboard that was configured in the Default Route.

What is the expected behavior?
That when the dashboard path is correctly configured in the tenants default path and a user logs in, the user is redirected to see that configured dashboard regardless of whether or not the current tenant is also the default tenant.

What is your host/environment?

  • OS: Linux Pop_OS
  • Version : 22.04 LTS
  • Plugins: whatever is provided out of the box, this is the most basic configuration (see docker-compose) file at the beginning of this bug report.

Do you have any screenshots?
This screenshot shows the error upon login:
Screenshot from 2023-11-29 09-34-17

This screenshot shows the dashboard with it's url in the address bar that is supposed to load after login:
Screenshot from 2023-11-29 09-35-51

This screenshot shows the default route for the "test-tenant" configured to redirect to the dashboard found in the previous screenshot
Screenshot from 2023-11-29 09-38-16

Do you have any additional context?
not at the moment, let me know if you have any further questions.

@reformit reformit added bug Something isn't working untriaged labels Nov 29, 2023
@cwperks cwperks added triaged and removed untriaged labels Dec 4, 2023
@cwperks
Copy link
Member

cwperks commented Dec 4, 2023

[Triage] Thank you for filing @reformit.

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

No branches or pull requests

2 participants