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

[Reporting] fix unsupported platform crash #120659

Merged

Conversation

tsullivan
Copy link
Member

@tsullivan tsullivan commented Dec 7, 2021

Summary

Caused by: #120110

This PR fixes a server crash that occurs when the platform doesn't have a supported Chromium binary available for Reporting.

Today, a user on the Darwin arm64 platform will get a crash when they try to start Kibana:

[2021-12-07T10:43:28.569-06:00][ERROR][plugins.screenshotting] Error in screenshotting setup, it may not function properly.
Unhandled Promise rejection detected:

Error: Unsupported platform: darwin-arm64
    at install (/Users/smith/Code/kibana/x-pack/plugins/screenshotting/server/browsers/install.ts:32:11)

Now, they will still see the error logged but the server will not crash. This change also has a proper stack trace logged:

[2021-12-07T10:27:21.833-07:00][ERROR][plugins.screenshotting] Error in screenshotting setup, it may not function properly.
[2021-12-07T10:27:21.834-07:00][ERROR][plugins.screenshotting] Error: Unsupported platform: darwin-arm64
    at install (/home/tsullivan/elastic/kibana/x-pack/plugins/screenshotting/server/browsers/install.ts:31:11)
    at /home/tsullivan/elastic/kibana/x-pack/plugins/screenshotting/server/plugin.ts:63:11
    at ScreenshottingPlugin.setup (/home/tsullivan/elastic/kibana/x-pack/plugins/screenshotting/server/plugin.ts:57:33)
    at PluginWrapper.setup (/home/tsullivan/elastic/kibana/src/core/server/plugins/plugin.ts:108:26)
    at PluginsSystem.setupPlugins (/home/tsullivan/elastic/kibana/src/core/server/plugins/plugins_system.ts:129:40)
    at PluginsService.setup (/home/tsullivan/elastic/kibana/src/core/server/plugins/plugins_service.ts:171:52)
    at Server.setup (/home/tsullivan/elastic/kibana/src/core/server/server.ts:282:26)
    at Root.setup (/home/tsullivan/elastic/kibana/src/core/server/root/index.ts:52:14)
    at bootstrap (/home/tsullivan/elastic/kibana/src/core/server/bootstrap.ts:101:5)
    at Command.<anonymous> (/home/tsullivan/elastic/kibana/src/cli/serve/serve.js:244:5)

When this error is logged, if the user tries to generate a PNG or PDF report in the Kibana instance, they will see a failed report with an appropriate error:
image
image

Checklist

Delete any items that are not applicable to this PR.

@tsullivan tsullivan marked this pull request as ready for review December 7, 2021 18:56
@tsullivan tsullivan added (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead Team:AppServicesUx v8.1.0 labels Dec 7, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServicesUx)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-reporting-services (Team:Reporting Services)

@tsullivan tsullivan added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes labels Dec 7, 2021
Copy link
Contributor

@smith smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected for me. Thank you!

@tsullivan tsullivan requested a review from dokmic December 7, 2021 20:09
@tsullivan tsullivan enabled auto-merge (squash) December 7, 2021 21:15
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@tsullivan tsullivan merged commit e62dc02 into elastic:main Dec 7, 2021
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Dec 7, 2021
@dokmic dokmic added the v8.0.0 label Dec 9, 2021
dokmic added a commit to dokmic/kibana that referenced this pull request Dec 9, 2021
* [Reporting] fix unsupported platform crash

* revert test code

* improve types and add test

* Apply suggestions from code review

Co-authored-by: Michael Dokolin <[email protected]>

* updates per feedback - remove the error class member

* add stack trace of error

* revert change to guard a type

Co-authored-by: Michael Dokolin <[email protected]>
dokmic added a commit that referenced this pull request Dec 9, 2021
* [Reporting] fix unsupported platform crash

* revert test code

* improve types and add test

* Apply suggestions from code review

Co-authored-by: Michael Dokolin <[email protected]>

* updates per feedback - remove the error class member

* add stack trace of error

* revert change to guard a type

Co-authored-by: Michael Dokolin <[email protected]>

Co-authored-by: Tim Sullivan <[email protected]>
TinLe pushed a commit to TinLe/kibana that referenced this pull request Dec 22, 2021
* [Reporting] fix unsupported platform crash

* revert test code

* improve types and add test

* Apply suggestions from code review

Co-authored-by: Michael Dokolin <[email protected]>

* updates per feedback - remove the error class member

* add stack trace of error

* revert change to guard a type

Co-authored-by: Michael Dokolin <[email protected]>
@tsullivan tsullivan deleted the reporting/fix-unsupported-platform-crash branch December 27, 2021 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience (Deprecated) Feature:Reporting Use Reporting:Screenshot, Reporting:CSV, or Reporting:Framework instead release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants