mahendrapaipuri / grafana-dashboard-reporter-app

A Grafana plugin app to create PDF reports of dashboards
Apache License 2.0
46 stars 4 forks source link

Can't access to Plugin Health Check #90

Closed Alan1810 closed 2 weeks ago

Alan1810 commented 2 weeks ago

Hi,

After upgrading from 1.4.1 to 1.5.0 on grafana 11.1.4, I can't access to Plugin Health Check (Apps > Grafana Dashboard Reporter)

I have an error in browser :

Error
failed to start browser: couldn't create browser context: exec: google-chrome: executable file not found in  $PATH

In grafana log, when accessing :

logger=accesscontrol.evaluator t=2024-08-23T12:40:26.636026542+02:00 level=debug msg="Matched scope" userscope=plugins:* targetscope=plugins:id:mahendrapaipuri-dashboardreporter-app
logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-08-23T12:40:26.697612017+02:00 level=info msg="new instance of plugin app created" endpoint=checkHealth pluginID=mahendrapaipuri-dashboardreporter-app
logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-08-23T12:40:26.698967672+02:00 level=info msg="starting plugin with initial config: Theme: light; Orientation: portrait; Layout: simple; Dashboard Mode: default; Time Zone: ; Encoded Logo: [truncated]; Max Renderer Workers: 4; Max Browser Workers: 2; Remote Chrome Addr: ; App URL: https://********/; TLS Skip verifiy: true; Included Panel IDs: all; Excluded Panel IDs: none" pluginID=mahendrapaipuri-dashboardreporter-app endpoint=checkHealth logger=plugin.mahendrapaipuri-dashboardreporter-app t=2024-08-23T12:40:26.699028164+02:00 level=debug msg="Plugin Request Completed" status=ok statusSource=plugin duration=1.134698ms endpoint=checkHealth pluginID=mahendrapaipuri-dashboardreporter-app
logger=context userId=1 orgId=1 uname=admin t=2024-08-23T12:40:26.699690925+02:00 level=info msg="Request Completed" method=GET path=/api/plugins/mahendrapaipuri-dashboardreporter-app/health status=400 remote_addr=10.12.240.138 time_ms=7 duration=7.255457ms size=148 referer=https://*******/a/mahendrapaipuri-dashboardreporter-app/status handler=/api/plugins/:pluginId/health status_source=server

Chrome is present in grafana-image-renderer :

logger=plugin.grafana-image-renderer t=2024-08-23T12:38:12.505834713+02:00 level=debug msg="Setting chromeBin to /var/lib/grafana/plugins/plugin-linux-x64-glibc/chrome/linux-129.0.6654.0/chrome-linux64/chrome"

Env: Ubuntu 22.04.4 grafana 11.1.4 grafana-dashboard-reporter 1.5.0 grafana-image-renderer 3.11.3 with chrome included

Any ideas ?

Best regards

mahendrapaipuri commented 2 weeks ago

Hello,

Thanks for opening this issue. I can confirm that this is a regression in 1.5.0. Prior to 1.5.0, the plugin was using the chrome binary shipped from grafana-image-renderer, if found. In 1.5.0, we made a lot of changes to support remote chrome instance and now we are relying on the chrome on PATH.

Have you installed chromium on the server where Grafana is running? The chrome shipped by grafana-image-renderer might not be enough as it still lacks quite a few shared libs. If you would not want or cannot install chromium, a work around would be to add /var/lib/grafana/plugins/plugin-linux-x64-glibc/chrome/linux-129.0.6654.0/chrome-linux64 to PATH so that chrome would be picked up the plugin.

I will fix it for the next release.

Alan1810 commented 2 weeks ago

I don't want to install chtomium to my server and adding chrome to PATH seems not working.

I donwgrade to 1.4.1 and will wait for the fix in the next release.

Regards.

mahendrapaipuri commented 1 week ago

@Alan1810 Please try out the main branch. I merged a PR to fix this regression.

Cheers