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

Editing a saved object from Management UI can corrupt the saved object #66542

Closed
markov00 opened this issue May 14, 2020 · 4 comments · Fixed by #66584
Closed

Editing a saved object from Management UI can corrupt the saved object #66542

markov00 opened this issue May 14, 2020 · 4 comments · Fixed by #66584
Assignees
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Saved Objects regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.8.0

Comments

@markov00
Copy link
Member

markov00 commented May 14, 2020

Kibana version:
7.8 BC2

Describe the bug:
When editing and saving a dashboard from the Management UI, the saved object lose all its references to each embeddable, causing two main issues:

  • the Dashboard no longer renders
  • the saved object is now corrupted

Steps to reproduce:

  1. add the Sample web log sample dataset
  2. open the [Logs] Web Traffic dashboard: it should render correctly
  3. now open the Stack Monitoring UI -> Saved object and Inspect the [Logs] Web Traffic saved object.
  4. note that the last field of the form, references always shows an empty array also if, inspecting the network or the real object saved into kibana, the references array has all the references to the used embeddable in the dashboard.

Screenshot 2020-05-14 at 12 17 28

  1. now edit one color on the dashboard panelJSON or simply click save
  2. return to the Dashboard and see that you can no longer see the visualizations and an error appear

Expected behavior:
The Saved Object UI should show and save all the references correctly.

Screenshots (if relevant):
Screenshot 2020-05-14 at 11 37 58

Errors in browser console (if relevant):
none

Provide logs and/or server output (if relevant):
no relevant logs

Any additional context:

I’ve investigated a bit more and I’ve found that this PR is probably the root cause: #61700

Seems that there is an issue when converting the saved object to the field list to be rendered on the saved object UI.
This can be located in src/plugins/saved_objects_management/public/lib/create_field_list.ts and consequentially in src/plugins/saved_objects_management/public/management_section/object_view/components/form.tsx
Seems that we are trying to get the references array from the attributes property of the SimpleSavedObject but they live on the root level of the same object.

@markov00 markov00 added bug Fixes for quality problems that affect the customer experience blocker Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc regression Feature:Saved Objects Feature:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages v7.8.0 labels May 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@pgayvallet
Copy link
Contributor

Real root cause is #59490, which was preliminary work for #61700.

@pgayvallet pgayvallet self-assigned this May 14, 2020
@pgayvallet
Copy link
Contributor

pgayvallet commented May 14, 2020

Caused by the removal of

// Special handling for references which isn't within "attributes"
createField(fields, obj.references, 'references');

During the migration of https://github.com/elastic/kibana/pull/59490/files#diff-1ae745e2ea3c5e223fe24671b08f4e20

7.7, 7.8 and 7.x branches are impacted.

@pgayvallet
Copy link
Contributor

pgayvallet commented May 16, 2020

Fix:
master: #66584
7.x: #66843
7.8: #66844
7.7: #66845

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:Kibana Management Feature label for Data Views, Advanced Setting, Saved Object management pages Feature:Saved Objects regression Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc v7.8.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants