Skip to content

[dashboard] fix invalid dashboard displayed as 404 instead of showing validation error#211661

Merged
nreese merged 7 commits intoelastic:mainfrom
nreese:issue_211659
May 7, 2025
Merged

[dashboard] fix invalid dashboard displayed as 404 instead of showing validation error#211661
nreese merged 7 commits intoelastic:mainfrom
nreese:issue_211659

Conversation

@nreese
Copy link
Contributor

@nreese nreese commented Feb 18, 2025

Closes #211659

PR updates loadDashboardState to throw content management error when status is not a 404. PR does not attempt to clean-up DashboardRenderer's display of the error.

Screenshot 2025-05-07 at 8 20 02 AM

test instructions

  1. use saved object import to import dashboard with schema errors - https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.
  2. open dashboard, verify schema validation error is displayed.
@nreese nreese marked this pull request as ready for review February 18, 2025 22:30
@nreese nreese requested a review from a team as a code owner February 18, 2025 22:30
@nreese nreese added release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.0.0 backport:version Backport to applied version labels v9.1.0 v8.19.0 labels Feb 18, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@nreese
Copy link
Contributor Author

nreese commented Feb 18, 2025

@elasticmachine merge upstream

@ThomThomson
Copy link
Contributor

Hey @elastic/ax-design folks! Would someone mind taking a look at a quick design for a generic non-404 Dashboard load error? Right now we're just pushing the raw error text - but a simple upgrade would be to render an empty page error component with a simple title and the full error message. Would that be sufficient?

@andreadelrio
Copy link
Contributor

Hey @elastic/ax-design folks! Would someone mind taking a look at a quick design for a generic non-404 Dashboard load error? Right now we're just pushing the raw error text - but a simple upgrade would be to render an empty page error component with a simple title and the full error message. Would that be sufficient?

@ThomThomson Yes, a simple EuiEmptyPrompt would do it. If we want to keep the implementation simple we can simply pass an icon to it (as opposed to an illustration). @florent-leborgne should we able to help us with the copy. Would it be possible to offer a recovery action in a button? if so we can include it.

<EuiEmptyPrompt
  iconType="error"
  iconColor="danger"
  title={<h2>Unable to load dashboard</h2>}
body={<p>Some details go here.</p>}
actions={
<EuiButton color="primary" fill>
  Some action we can offer you
</EuiButton>
}
/>
image
@nreese nreese removed the v9.0.0 label May 7, 2025
@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #105 / Cloud Security Posture Vulnerabilities Page - DataTable "before all" hook in "Vulnerabilities Page - DataTable"

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
dashboard 549.8KB 550.2KB +414.0B

History

@nreese nreese merged commit 670ff4e into elastic:main May 7, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/14891723430

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request May 7, 2025
… validation error (elastic#211661)

Closes elastic#211659

PR updates `loadDashboardState` to throw content management error when
status is not a 404. PR does not attempt to clean-up DashboardRenderer's
display of the error.

<img width="500" alt="Screenshot 2025-05-07 at 8 20 02 AM"
src="https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b"
/>

### test instructions
1) use saved object import to import dashboard with schema errors -
https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.
2) open dashboard, verify schema validation error is displayed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
(cherry picked from commit 670ff4e)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request May 7, 2025
…showing validation error (#211661) (#220427)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[dashboard] fix invalid dashboard displayed as 404 instead of showing
validation error
(#211661)](#211661)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Nathan
Reese","email":"reese.nathan@elastic.co"},"sourceCommit":{"committedDate":"2025-05-07T19:32:04Z","message":"[dashboard]
fix invalid dashboard displayed as 404 instead of showing validation
error (#211661)\n\nCloses
https://github.com/elastic/kibana/issues/211659\n\nPR updates
`loadDashboardState` to throw content management error when\nstatus is
not a 404. PR does not attempt to clean-up DashboardRenderer's\ndisplay
of the error.\n\n<img width=\"500\" alt=\"Screenshot 2025-05-07 at 8 20
02 AM\"\nsrc=\"https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b\"\n/>\n\n\n###
test instructions\n1) use saved object import to import dashboard with
schema errors
-\nhttps://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.\n2)
open dashboard, verify schema validation error is
displayed.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"670ff4ee06089711a20201c0093c83abbe4db2bf","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:Presentation","backport:version","v9.1.0","v8.19.0"],"title":"[dashboard]
fix invalid dashboard displayed as 404 instead of showing validation
error","number":211661,"url":"https://github.com/elastic/kibana/pull/211661","mergeCommit":{"message":"[dashboard]
fix invalid dashboard displayed as 404 instead of showing validation
error (#211661)\n\nCloses
https://github.com/elastic/kibana/issues/211659\n\nPR updates
`loadDashboardState` to throw content management error when\nstatus is
not a 404. PR does not attempt to clean-up DashboardRenderer's\ndisplay
of the error.\n\n<img width=\"500\" alt=\"Screenshot 2025-05-07 at 8 20
02 AM\"\nsrc=\"https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b\"\n/>\n\n\n###
test instructions\n1) use saved object import to import dashboard with
schema errors
-\nhttps://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.\n2)
open dashboard, verify schema validation error is
displayed.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"670ff4ee06089711a20201c0093c83abbe4db2bf"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/211661","number":211661,"mergeCommit":{"message":"[dashboard]
fix invalid dashboard displayed as 404 instead of showing validation
error (#211661)\n\nCloses
https://github.com/elastic/kibana/issues/211659\n\nPR updates
`loadDashboardState` to throw content management error when\nstatus is
not a 404. PR does not attempt to clean-up DashboardRenderer's\ndisplay
of the error.\n\n<img width=\"500\" alt=\"Screenshot 2025-05-07 at 8 20
02 AM\"\nsrc=\"https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b\"\n/>\n\n\n###
test instructions\n1) use saved object import to import dashboard with
schema errors
-\nhttps://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.\n2)
open dashboard, verify schema validation error is
displayed.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by:
Elastic Machine
<elasticmachine@users.noreply.github.com>","sha":"670ff4ee06089711a20201c0093c83abbe4db2bf"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Nathan Reese <reese.nathan@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
… validation error (elastic#211661)

Closes elastic#211659

PR updates `loadDashboardState` to throw content management error when
status is not a 404. PR does not attempt to clean-up DashboardRenderer's
display of the error.

<img width="500" alt="Screenshot 2025-05-07 at 8 20 02 AM"
src="https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b"
/>


### test instructions
1) use saved object import to import dashboard with schema errors -
https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.
2) open dashboard, verify schema validation error is displayed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
… validation error (elastic#211661)

Closes elastic#211659

PR updates `loadDashboardState` to throw content management error when
status is not a 404. PR does not attempt to clean-up DashboardRenderer's
display of the error.

<img width="500" alt="Screenshot 2025-05-07 at 8 20 02 AM"
src="https://github.com/user-attachments/assets/39883951-d4df-46fa-9950-bb8103898b6b"
/>


### test instructions
1) use saved object import to import dashboard with schema errors -
https://github.com/elastic/kibana/blob/main/x-pack/test/functional/apps/dashboard/group2/migration_smoke_tests/exports/lens_dashboard_migration_test_7_12_1.ndjson.
2) open dashboard, verify schema validation error is displayed.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v8.19.0 v9.1.0

5 participants