-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Reporting] Handle error gracefully when browser driver unexpectedly exits or crashes. #71989
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stringifying error objects in a message has shown to cause problems where the error context or error data gets lost. I searched the code to see if this is happening in other places and fixed them in this PR.
x-pack/plugins/reporting/server/browsers/chromium/driver_factory/index.ts
Outdated
Show resolved
Hide resolved
joelgriffith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Rx.Subject calls might use fromEvent to make it a little cleaner.
f6b3187 to
7bc1733
Compare
|
As they are these changes fix the problem of the server crashing on the |
e6126b5 to
d491dab
Compare
x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts
Outdated
Show resolved
Hide resolved
ebcc598 to
36ae0cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting this as a function that returns an Error, so that when we need to throw the error, the stack trace makes sense.
573eb22 to
cdb8b25
Compare
…le of the screenshot pipeline
cdb8b25 to
ad52460
Compare
|
A Reporting functional test is failing, because the archived data used in tests violates the new network policy in the reporting_api_integration config. |
|
I was out for a few days. Coming back to this... |
|
@elasticmachine merge upstream |
x-pack/plugins/reporting/server/browsers/chromium/driver/chromium_driver.ts
Show resolved
Hide resolved
joelgriffith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the network_policy test 👏
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…exits or crashes. (elastic#71989) * [Reporting] Handle page error event directly with Puppeteer * clean up logger.error that was stringifying error * use fromEvent * better handling and error messaging if browser was closed in the middle of the screenshot pipeline * fix pdf functional api tests * fix i18n error * fix jest * fix ts * fix i18n * tweaks * ok to throw error in callback * fix ts Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…exits or crashes. (#71989) (#74190) * [Reporting] Handle page error event directly with Puppeteer * clean up logger.error that was stringifying error * use fromEvent * better handling and error messaging if browser was closed in the middle of the screenshot pipeline * fix pdf functional api tests * fix i18n error * fix jest * fix ts * fix i18n * tweaks * ok to throw error in callback * fix ts Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
Closes #71481
I also ran into the scenario where Chromium ran out of memory on the Kibana page, and an unhandled promise rejection from that caused the Kibana server to crash.
Release note: fixed a bug where the Kibana server could crash if the Reporting server-side headless browser crashes.
Checklist
Delete any items that are not applicable to this PR.
Screenshots