Kibana: Dashboards and visualizations using non-default space are throwing a type error

Created on 4 Feb 2019  路  13Comments  路  Source: elastic/kibana

Kibana version: 7.0 snapshots

Elasticsearch version: 7.0 snapshots

Server OS version: Linux

Browser version: Chrome

Browser OS version: Master

Original install method (e.g. download page, yum, from source, etc.):
Snapshots

Describe the bug:
Error loading dashboard in non-default space

Steps to reproduce:
Install ES/Kibana
Load sample dashboards
Create another space, go to that space and load sample data
Try to load dashboard for that sample data
When loading visualization - the TypeError occurs and the visualization does not open

Uncaught (in promise) TypeError: Cannot read property 'create' of undefined
at DashboardPanelUi._callee$ (commons.bundle.js:4)
at tryCatch (vendors.bundle.dll.js:480)
at Generator.invoke [as _invoke] (vendors.bundle.dll.js:480)
at Generator.prototype.(anonymous function) [as next] (https://localhost:5601/built_assets/dlls/vendors.bundle.dll.js:480:448402)
at step (commons.bundle.js:4)
at commons.bundle.js:4
at new Promise ()
at DashboardPanelUi. (commons.bundle.js:4)
at DashboardPanelUi.componentDidMount (commons.bundle.js:4)
at Hi (vendors.bundle.dll.js:217)

screenshot from 2019-02-03 23-05-24

Dashboard Visualizations Core KibanaApp blocker bug regression v7.0.0

Most helpful comment

I can reproduce on the cloud on 7.0 snapshot (2/6 - pre-BC)
https://54e8e2582ebc4862b454db235afae497.us-central1.gcp.foundit.no:9243
User: elastic / ojs2OQrLqe9AoraoTqIRh7Uh
Go to Raya Fratkina space and try to open any of the sample data dashboards.

All 13 comments

Pinging @elastic/kibana-app

@ppisljar @lukeelmers another candidate to validate for pre/post revert

Seems to be OK in the current 6.7.0-SNAPSHOT.
My steps;

  1. As elastic user, create a space named space1
  2. Create a role named role1 with read access to the default space and all access to space1
  3. Create a user named space1 with roles role1 plus other roles that give read and view_meta_data access to the data including to be able to add kibana_sample_data*
  4. Log in as space1 user
  5. Add Web Logs sample data
  6. View that Sample Data dashboard. Everything rendered correctly in Chrome browser.

I'm also unable to reproduce this on master. Tested with both the traditional vis data loader and the new pipeline loader.

I added a functional test last week which should fail in this exact situation (assuming the test is doing its job, of course): #29459

I am still able to reproduce on latest master snapshot

I can reproduce on the cloud on 7.0 snapshot (2/6 - pre-BC)
https://54e8e2582ebc4862b454db235afae497.us-central1.gcp.foundit.no:9243
User: elastic / ojs2OQrLqe9AoraoTqIRh7Uh
Go to Raya Fratkina space and try to open any of the sample data dashboards.

Interesting. I'm at a little bit of a loss on this one; I'm currently running the following snapshots on my machine:

https://snapshots.elastic.co/downloads/kibana/kibana-7.0.0-SNAPSHOT-darwin-x86_64.tar.gz
https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-SNAPSHOT-darwin-x86_64.tar.gz
  1. Checkout 7.0 branch.
  2. yarn es snapshot to start ES (will pull from the snapshot link above).
  3. Download kibana snapshot & untar.
  4. ./bin/kibana to start kibana.
  5. Fire up kibana and immediately create new (non-default) space.
  6. Switch to the new space.
  7. Load sample data (I've tried all three)
  8. Go to sample data dashboard.

Everything loads as expected for me. I can see the issue in the cloud instance that @rayafratkina posted, but that's the only place I've been able to reproduce. Do we know when that cloud instance was deployed? Maybe it was an older version of the 7.0.0 snapshot?

@liza-mae Is there any more direction you could provide on exactly how you are running kibana to reproduce this?

@lukeelmers can you try to load the sample data from default space first, then switch to non-default and load sample data. It should reproduce that way. Let me know. Thanks.

Thanks! That did the trick. I took some time to test this in more depth... here are my findings:

  • This issue is present even after reverting the pipeline data loader, so it is not likely to be related.
  • This issue is __not__ present in 6.6 or 6.7, but it __is__ present on master (8.0), 7.x and 7.0.
  • I did a git bisect, and it pinpointed this PR:

    • Add new "references" attribute to saved objects for relationships (#28199) (https://github.com/elastic/kibana/commit/1b0f595f01b3cff1d63a709d31df854c362e168d)

    • I reverted the PR, tested, and confirmed that the issue is no longer present.

  • This is only reproducible under very specific circumstances; see below.

To Reproduce

  • Add sample data to the default space __first__.

    • if you start with an empty default space, create a custom space, and add sample data to the custom space, everything is fine.

  • Then create a new custom space, and add the same sample data to it.
  • The sample datasets added to the default & custom spaces must be __the same__.

    • if you add ecommerce data to default space, and web logs to the custom space, everything works...

    • ...but it fails if you add web logs data to both.



      • This is also why the test added in #29459 hadn't caught the issue: it adds different datasets to each space, rather than the same ones. (I will update the test to address this case).



  • Now when you navigate to a dashboard in the custom space, an error displays. If you try to view an individual vis, you get an empty page.

@mikecote Any ideas what might be going on here? The stack trace originates around
saved_objects_client_provider.js:42 and saved_object.js:220

Pinging @elastic/kibana-platform

@lukeelmers It turns out the migrations I created mutate the data and when you try to add it in the system a second time, data is missing. Another way to reproduce this is to add sample data, remove it, add it again and you will notice dashboards don't load properly. I will create a PR to remove data mutations no later than tomorrow.

Ah, interesting. Thanks for the insight! Ping me if there鈥檚 anything I can do to help or test this out.

@lukeelmers I have assigned you as a reviewer for the PR that will solve this issue (#30475). Let me know if there's questions or issues with the fix.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rashidkpc picture rashidkpc  路  116Comments

panda87 picture panda87  路  206Comments

ctindel picture ctindel  路  81Comments

Alex-Ikanow picture Alex-Ikanow  路  364Comments

bquartier picture bquartier  路  79Comments