Custom Plugin: Unable to render image from Share Panel -> Link

I’ve built a custom plugin that I believe supports snapshots.

I’m able to create a local snapshot of the dashboard and the plugin does display data when the generated URL is opened. But, when I try to create an image for the panel (via Share Panel -> Link) - the page displays “Server side error”. Also, I dont see any real helpful message in the logs.

Logs:

INFO[02-05|17:16:59] Rendering logger=png-renderer path=“dashboard-solo/db/sfreports-historic?orgId=1&panelId=4&from=1517270400000&to=1517330644631&var-adv=All&var-report=<report>&width=1000&height=500&tz=UTC-08%3A00”
EROR[02-05|17:17:59] Timeout error. You can set timeout in seconds with &timeout url parameter logger=context userId=1 orgId=1 uname=admin error=“Timeout error. You can set timeout in seconds with &timeout url parameter”
EROR[02-05|17:17:59] Rendering failed. logger=context userId=1 orgId=1 uname=admin error=“Timeout error. You can set timeout in seconds with &timeout url parameter”
2018/02/05 17:17:59 http: multiple response.WriteHeader calls
EROR[02-05|17:17:59] Request Completed logger=context userId=1 orgId=1 uname=admin method=GET path=/render/dashboard-solo/db/sfreports-historic status=500 remote_addr=[::1] time_ms=60009 size=2298 referer=“http://localhost:3000/dashboard/db/sfreports-historic?orgId=1
INFO[02-05|17:17:59] Request Completed logger=context userId=1 orgId=1 uname=admin method=GET path=/public/css/fonts.min.css status=404 remote_addr=[::1] time_ms=3 size=23449 referer=“http://localhost:3000/render/dashboard-solo/db/sfreports-historic?orgId=1&panelId=4&from=1517270400000&to=1517330644631&var-adv=All&var-report=<report>&width=1000&height=500&tz=UTC-08%3A00”
INFO[02-05|17:17:59] Request Completed logger=context userId=1 orgId=1 uname=admin method=GET path=/public/build/grafana.dark.min.css status=404 remote_addr=[::1] time_ms=3 size=23449 referer=“same link as above”

Error message in the browser

be sure to call this.renderCompleted() from your panel controller when you have finished rendering

This fixed it. Thank you