Auto fit map to bounds does not work consistently in watchers

Hi,

We are using elastic watchers to automatically generate pdf reports of our dashboards. In this dashboard we use a Maps visualisation with Auto fit map to bounds selected. In most of the generated pdf reports this works fine:

However, sometimes no zoom is applied:
Screenshot 2021-07-05 114331 no auto fit

I don't have any clue why this happens. Generating the pdf reports manually does not give any problems and the reporting page also does not show errors for these reports. Does anyone have an idea on how to fix this? Thanks!

hi @MAvD

thx for logging. This seems to be a bug. I don't think there is a particular thing you can do to resolve this.

A few questions to help with debugging:

  • does the "fit-to-data" button consistently work on those maps when they are embedded in a dashboard? (the little expando-arrow icon on the top-left). In other words, if you open those dashboards, and click the button, does the map zoom correctly to the data?
  • are there any errors or warnings in the kibana-server logs?

thanks!

Hi,

Thanks for your reply.

Yes, the "fit-to-data" works fine in the dashboard that is used for the pdf reports.

Tonight 4 out of 17 watcher reports showed a map with no zoom applied. I could only see 1 error message in the kibana-server logs. Perhaps you can see what is going wrong:

[instance-0000000063] failed to execute action ["..."/email_report] org.elasticsearch.ElasticsearchException: Watch["..."] reporting["...".pdf] Error when polling pdf from host["...".europe-west1.gcp.cloud.es.io], port[9243], method[POST], path[/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."}] at org.elasticsearch.xpack.watcher.notification.email.attachment.ReportingAttachmentParser.toAttachment(ReportingAttachmentParser.java:196) ~[x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.notification.email.attachment.ReportingAttachmentParser.toAttachment(ReportingAttachmentParser.java:53) ~[x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.actions.email.ExecutableEmailAction.execute(ExecutableEmailAction.java:63) [x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.core.watcher.actions.ActionWrapper.execute(ActionWrapper.java:187) [x-pack-core-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:534) [x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:320) [x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.execution.ExecutionService.lambda$executeAsync$5(ExecutionService.java:421) [x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:627) [x-pack-watcher-7.11.1.jar:7.11.1] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:673) [elasticsearch-7.11.1.jar:7.11.1] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?] at java.lang.Thread.run(Thread.java:832) [?:?]

Thanks!