**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.