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

Dashboards and visualizations using non-default space are throwing a type error #29926

Closed
liza-mae opened this issue Feb 4, 2019 · 13 comments
Closed
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features Feature:Visualizations Generic visualization features (in case no more specific feature label is available) regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0

Comments

@liza-mae
Copy link
Contributor

liza-mae commented Feb 4, 2019

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

@liza-mae liza-mae added bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features Feature:Visualizations Generic visualization features (in case no more specific feature label is available) Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Feb 4, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@timroes
Copy link
Contributor

timroes commented Feb 5, 2019

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

@LeeDr
Copy link

LeeDr commented Feb 6, 2019

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.

@lukeelmers
Copy link
Member

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

@liza-mae
Copy link
Contributor Author

liza-mae commented Feb 6, 2019

I am still able to reproduce on latest master snapshot

@rayafratkina
Copy link
Contributor

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.

@lukeelmers
Copy link
Member

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?

@liza-mae
Copy link
Contributor Author

liza-mae commented Feb 7, 2019

@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.

@lukeelmers
Copy link
Member

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:
  • 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.
  • 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

@lukeelmers lukeelmers changed the title Dahsboards and visualizations using non-default space are throwing a type error Dashboards and visualizations using non-default space are throwing a type error Feb 8, 2019
@lukeelmers lukeelmers added the Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc label Feb 8, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

@mikecote
Copy link
Contributor

mikecote commented Feb 8, 2019

@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.

@lukeelmers
Copy link
Member

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

@mikecote
Copy link
Contributor

mikecote commented Feb 8, 2019

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Dashboard Dashboard related features Feature:Visualizations Generic visualization features (in case no more specific feature label is available) regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.0.0
Projects
None yet
Development

No branches or pull requests

7 participants