# Browser was closed unexpectedly error when sending report

**URL:** https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671
**Category:** Elasticsearch
**Tags:** elastic-stack-alerting
**Created:** [April 20, 2021, 8:14am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671 "2021-04-20T08:14:20Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![NightSpark](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@NightSpark](https://discuss.elastic.co/u/NightSpark)
#### Post date: [April 20, 2021, 8:14am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/1 "2021-04-20T08:14:20Z")

</div>

Hi

In ElasticCloud 7.12 and I have a watcher with a reporting action which sends a report at 5pm each day.  
It works about 50% of the time with the other times producing the following error

"Reporting generation failed: Error: Browser was closed unexpectedly! Check the server logs for more info."

Is there anyway to get more information as to the root cause?

Thanks

---

<div class="post-metadata">

### Author: ![jakn](https://avatars.discourse-cdn.com/v4/letter/j/bbe5ce/32.png) [@jakn](https://discuss.elastic.co/u/jakn)
#### Post date: [April 26, 2021, 11:20am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/2 "2021-04-26T11:20:18Z")

</div>

Since upgrading to ElasticCloud 7.12 I have also observed this error sporadically.

In a cloud deployment, created almost 3 years ago as v6.2.4 and upgraded multiple times since then, we have a dashboard for which we have had a watcher triggering a daily PDF report for 2 years now. Not until we upgraded to v7.12 did we see this error with status [500]:  
`Internal Server Error. Reporting generation failed: Error: Browser was closed unexpectedly! Check the server logs for more info.`

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [April 26, 2021, 1:30pm UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/3 "2021-04-26T13:30:45Z")

</div>

I think that the support team should be aware of this behavior.

Please see [Support for Elastic Cloud, Hosted Elasticsearch | Elastic](https://www.elastic.co/cloud/elasticsearch-service/support) on how to raise a support ticket for Elastic Cloud 🙂

---

<div class="post-metadata">

### Author: ![NightSpark](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@NightSpark](https://discuss.elastic.co/u/NightSpark)
#### Post date: [April 26, 2021, 10:40pm UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/4 "2021-04-26T22:40:26Z")

</div>

Thanks @dadoonet I will raise a support ticket for cloud.

---

<div class="post-metadata">

### Author: ![erictung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erictung/32/109492_2.png) [@erictung](https://discuss.elastic.co/u/erictung)
#### Post date: [May 20, 2021, 7:16am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/5 "2021-05-20T07:16:04Z")

</div>

Looks like this issue is not only on Elastic Cloud - it's also happening with my on-prem installations too (using Docker images).

Including the link to GitHub issues:

> <https://github.com/elastic/kibana/issues/100007>
>
> \*\*Kibana version:\*\*
> 7.12.1 (using Docker image from docker.elastic.co)
> 
> \*\*Ela…sticsearch version:\*\*
> 7.12.1 (using Docker image from docker.elastic.co)
> 
> \*\*Server OS version:\*\*
> CentOS 7
> 
> \*\*Browser version:\*\*
> Not applicable to this issue
> 
> \*\*Browser OS version:\*\*
> Not applicable to this issue
> 
> \*\*Original install method (e.g. download page, yum, from source, etc.):\*\*
> Using Docker image from docker.elastic.co)
> 
> \*\*Describe the bug:\*\*
> PDF Reporting generation via Watcher fails occasionally (about 50% of all tasks). The error section of the Watcher execution result shows this:
> \`\`\`
> "error": {
> "root\_cause": \[
> {
> "type": "exception",
> "reason": "Watch\[cloudflare-reporting-daily\] reporting\[cf-security.pdf\] Error when polling pdf from host\[kibana\], port\[5601\], method\[POST\], path\[/s/pg-team/api/reporting/generate/printablePdf\], status\[500\], body\[{\\"statusCode\\":500,\\"error\\":\\"Internal Server Error\\",\\"message\\":\\"Reporting generation failed: Error: Browser was closed unexpectedly! Check the server logs for more info.\\"}\]"
> }
> \],
> "type": "exception",
> "reason": "Watch\[cloudflare-reporting-daily\] reporting\[cf-security.pdf\] Error when polling pdf from host\[kibana\], port\[5601\], method\[POST\], path\[/s/pg-team/api/reporting/generate/printablePdf\], status\[500\], body\[{\\"statusCode\\":500,\\"error\\":\\"Internal Server Error\\",\\"message\\":\\"Reporting generation failed: Error: Browser was closed unexpectedly! Check the server logs for more info.\\"}\]"
> }
> \`\`\`
> 
> And the Kibana server logs show this:
> \`\`\`
> {"type":"response","@timestamp":"2021-05-13T00:31:16+00:00","tags":\[\],"pid":7,"method":"get","statusCode":500,"req":{"url":"/api/reporting/jobs/download/kom5oml60007a746a64z2anj","method":"get","headers":{"accept-charset":"UTF-8","kbn-xsrf":"reporting","content-length":"0","host":"pka-kibana:5601","connection":"Keep-Alive","user-agent":"Apache-HttpClient/4.5.10 (Java/16)","accept-encoding":"gzip,deflate"},"remoteAddress":"127.0.0.1","userAgent":"Apache-HttpClient/4.5.10 (Java/16)"},"res":{"statusCode":500,"responseTime":116,"contentLength":168},"message":"GET /api/reporting/jobs/download/kom5oml60007a746a64z2anj 500 116ms - 168.0B"}
> \`\`\`
> 
> \*\*Steps to reproduce:\*\*
> 1. Requires Gold license and above.
> 2. Navigate to any Kibana dashboard.
> 3. On the menu bar, click Share - PDF Reports - Copy POST URL
> 4. Configure an \[SMTP profile\](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#configuring-email) so that Watcher can send email to recipients.
> 5. Create a new watch in Watcher via "\[Create or update watch API\](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html)" - must include the Email action and \[specify the attachment to be sent\](https://www.elastic.co/guide/en/elasticsearch/reference/current/actions-email.html#configuring-email-attachments) by pasting the POST URL that you just copied.
> 6. Manually execute the watch via "\[Execute watch API\](https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html)".
> 7. Execute the watch multiple times and you will see Error 500 occasionally.
> 
> \*\*Expected behavior:\*\*
> You will see not all tasks executed successfully.
> 
> \*\*Screenshots (if relevant):\*\*
> !\[image\](https://user-images.githubusercontent.com/41339955/118066723-c9328480-b3d1-11eb-85f3-c30d3ae3f240.png)
> 
> \*\*Errors in browser console (if relevant):\*\*
> None
> 
> \*\*Provide logs and/or server output (if relevant):\*\*
> \`\`\`
> {"type":"response","@timestamp":"2021-05-13T00:31:16+00:00","tags":\[\],"pid":7,"method":"get","statusCode":500,"req":{"url":"/api/reporting/jobs/download/kom5oml60007a746a64z2anj","method":"get","headers":{"accept-charset":"UTF-8","kbn-xsrf":"reporting","content-length":"0","host":"pka-kibana:5601","connection":"Keep-Alive","user-agent":"Apache-HttpClient/4.5.10 (Java/16)","accept-encoding":"gzip,deflate"},"remoteAddress":"127.0.0.1","userAgent":"Apache-HttpClient/4.5.10 (Java/16)"},"res":{"statusCode":500,"responseTime":116,"contentLength":168},"message":"GET /api/reporting/jobs/download/kom5oml60007a746a64z2anj 500 116ms - 168.0B"}
> \`\`\`
> 
> \*\*Any additional context:\*\*
> You should be able to reproduce the error with PNG reports - not only PDF reports. Looks like the issue is coming from the headless Chromium browser.

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [May 20, 2021, 7:48am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/6 "2021-05-20T07:48:09Z")

</div>

I had a similar issue and I fixed it by increasing the RAM available for my Kibana instance.

This page could be helpful.

> **[Reporting troubleshooting | Kibana Guide \[7.12\] | Elastic](https://www.elastic.co/guide/en/kibana/current/reporting-troubleshooting.html#reporting-troubleshooting-system-requirements)**

---

<div class="post-metadata">

### Author: ![erictung](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/erictung/32/109492_2.png) [@erictung](https://discuss.elastic.co/u/erictung)
#### Post date: [May 20, 2021, 12:02pm UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/7 "2021-05-20T12:02:17Z")

</div>

Probably the latest Chromium engine in Kibana 7.12 is using more RAM?

Maybe the OP can try to increase the RAM of the Kibana instance of his Elastic Cloud deployment and see whether the issue can be resolved.

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [May 20, 2021, 4:29pm UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/8 "2021-05-20T16:29:31Z")

</div>

> [@erictung](#):
>
> Probably the latest Chromium engine in Kibana 7.12 is using more RAM?

I believe the upgrade issues indicate that the Kibana server takes more RAM between releases and leaves less available for the Chromium browser.

---

<div class="post-metadata">

### Author: ![NightSpark](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@NightSpark](https://discuss.elastic.co/u/NightSpark)
#### Post date: [May 26, 2021, 10:56am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/9 "2021-05-26T10:56:57Z")

</div>

Thanks for feedback.

I have done a number of things which has improved stability

- increased RAM
- increased time between retries
- ensured that other reports did not get sent out at similar times

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 23, 2021, 10:57am UTC](https://discuss.elastic.co/t/browser-was-closed-unexpectedly-error-when-sending-report/270671/10 "2021-06-23T10:57:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
