hassio-addons / addon-grafana

Grafana - Home Assistant Community Add-ons
https://addons.community
MIT License
221 stars 61 forks source link

Grafana Image rendering issues #211

Closed debsahu closed 2 years ago

debsahu commented 2 years ago

Problem/Motivation

Image rendering fails and opening new issue because #155 is closed and locked

Expected behavior

Image rendering should work as per #210

Actual behavior

image

logs

t=2021-09-24T11:51:47-0400 lvl=eror msg="Failed to get browser version" logger=plugins.backend pluginId=grafana-image-renderer err=map[]
t=2021-09-24T11:52:47-0400 lvl=info msg=Rendering logger=rendering renderer=plugin path="d-solo/IPOUl8lZk/rtlamr?orgId=1&refresh=30m&from=1632412366099&to=1632498766099&panelId=6&width=1000&height=500&tz=America/New_York"
t=2021-09-24T11:52:47-0400 lvl=eror msg="Render request failed" logger=plugins.backend pluginId=grafana-image-renderer url="http://localhost:3000/d-solo/IPOUl8lZk/rtlamr?orgId=1&refresh=30m&from=1632412366099&to=1632498766099&panelId=6&width=1000&height=500&tz=America/New_York&render=1" error="Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"
t=2021-09-24T11:52:47-0400 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="rendering failed: Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"

Steps to reproduce

Share a graph > Export rendered image

Proposed changes

Update dependencies?

frenck commented 2 years ago

Please provide version information

debsahu commented 2 years ago

I'm on latest release v7.2.0 of grafana-addon

cpainchaud commented 2 years ago

same here ! it says that image renderer plugin is not available on arm7 architecture

frenck commented 2 years ago

same here ! it says that image renderer plugin is not available on arm7 architecture

That doesn't sound the same, as indeed this will never work on the arm7 architecture... That is not a bug, but a known limitation of the architecture in combination with Grafana

frenck commented 2 years ago

@debsahu

Could you add some system information with that? e.g., the output of ha info ?

debsahu commented 2 years ago

@debsahu

Could you add some system information with that? e.g., the output of ha info ?

System Health

version core-2021.9.7
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.0-0.bpo.7-amd64
arch x86_64
timezone America/Detroit
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4974 Installed Version | 1.15.2 Stage | running Available Repositories | 885 Installed Repositories | 17
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Debian GNU/Linux 10 (buster) -- | -- update_channel | stable supervisor_version | supervisor-2021.09.6 docker_version | 20.10.8 disk_total | 1927.2 GB disk_used | 51.2 GB healthy | true supported | true supervisor_api | ok version_api | ok installed_addons | Home Assistant Google Drive Backup (0.105.2), Samba share (9.5.1), Node-RED (10.0.1), Glances (0.13.0), File editor (5.3.3), WireGuard (0.5.1), Network UPS Tools (0.8.0), FTP (4.2.1), Mosquitto broker (6.0.1), Portainer (2.0.0), Grafana (7.2.0), Terminal & SSH (9.2.1), Visual Studio Code (3.6.2), InfluxDB (4.2.1), motionEye (0.15.1), NGINX Home Assistant SSL proxy (3.0.2), Log Viewer (0.12.0), Let's Encrypt (4.11.0), AdGuard Home (4.1.9), Nginx Proxy Manager (0.11.0), eWeLink Smart Home (1.2.1), Frigate NVR (2.0), ESPHome (2021.9.2), MariaDB (2.4.0), phpMyAdmin (0.5.0), Nextcloud Backup (0.16.4), TasmoBackup (1.04.23), TasmoAdmin (0.15.0), Tailscale (0.2.0)
Lovelace dashboards | 1 -- | -- resources | 6 views | 7 mode | storage
debsahu commented 2 years ago

Would any of these resources help? https://github.com/grafana/grafana-image-renderer/issues/159

SirJohnDoe commented 2 years ago

I just moved Grafana from Windows server 2019 to HassOS running in Virtualbox and have the same issue.

Is it possible that there are dependencies missing in the docker container?

Looks like it failed on loading shared library 'libxshmfence.so.1'

t=2021-11-06T16:44:13+0100 lvl=eror msg="Failed to get browser version" logger=plugins.backend pluginId=grafana-image-renderer err=map[]
t=2021-11-06T16:51:52+0100 lvl=info msg=Rendering logger=rendering renderer=plugin path="d-solo/BDVAECK7z/stromer-kilometers?orgId=1&from=1633618308479&to=1636213908479&panelId=2&width=1000&height=500&tz=Europe/Amsterdam" t=2021-11-06T16:51:52+0100 lvl=eror msg="Render request failed" logger=plugins.backend pluginId=grafana-image-renderer url="http://localhost:3000/d-solo/BDVAECK7z/stromer-kilometers?orgId=1&from=1633618308479&to=1636213908479&panelId=2&width=1000&height=500&tz=Europe/Amsterdam&render=1" error="Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"
t=2021-11-06T16:51:52+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="rendering failed: Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"
t=2021-11-06T16:51:52+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/BDVAECK7z/stromer-kilometers status=500 remote_addr="[REMOVED]" time_ms=78 size=769 referer=

System Health

version core-2021.11.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.9.7
os_name Linux
os_version 5.10.75
arch x86_64
timezone Europe/Amsterdam
Home Assistant Community Store GitHub API | ok -- | -- Github API Calls Remaining | 4931 Installed Version | 1.16.0 Stage | running Available Repositories | 956 Installed Repositories | 11
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | pending
Home Assistant Supervisor host_os | Home Assistant OS 6.6 -- | -- update_channel | stable supervisor_version | supervisor-2021.10.8 docker_version | 20.10.8 disk_total | 98.4 GB disk_used | 24.1 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Samba share (9.5.1), File editor (5.3.3), SSH & Web Terminal (9.0.1), Zigbee2mqtt (1.22.0-2), Mosquitto broker (6.0.1), Home Assistant Google Drive Backup (0.105.2), AdGuard Home (4.1.9), WireGuard (0.5.1), Tautulli (2.3.0), Vaultwarden (Bitwarden) (0.13.0), AppDaemon 4 (0.7.0), NGINX Home Assistant SSL proxy (3.0.2), Duck DNS (1.14.0), Check Home Assistant configuration (3.9.0), InfluxDB (4.2.1), Nextcloud Backup (0.16.4), MariaDB (2.4.0), Portainer (2.0.0), sonarr (0.7.0), radarr (0.8.1), Grafana (7.2.0)
Lovelace dashboards | 1 -- | -- resources | 4 views | 4 mode | storage
Spotify api_endpoint_reachable | ok -- | --
frenck commented 2 years ago

I've released a new version of the add-on. I've tested the image rendering on a similar setup, which now work. Could you check again?

debsahu commented 2 years ago

Same issue persists v.7.3.0

t=2021-11-11T13:39:12-0500 lvl=eror msg="Render request failed" logger=plugins.backend pluginId=grafana-image-renderer url="http://localhost:3000/d-solo/IPOUl8lZk/rtlamr?orgId=1&refresh=30m&from=1636569550111&to=1636655950111&panelId=6&width=1000&height=500&tz=America/New_York&render=1" error="Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"
t=2021-11-11T13:39:12-0500 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="rendering failed: Error: Failed to launch the browser process!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libxshmfence.so.1: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md\n"
t=2021-11-11T13:39:12-0500 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/IPOUl8lZk/rtlamr status=500 remote_addr="104.191.245.15, 104.191.245.15, 172.30.33.10, 172.30.32.1" time_ms=8 size=676 referer=
SirJohnDoe commented 2 years ago

hi @frenck thanks for the update, but as debsahu mentioned the issue persists and I get the same error message as I posted earlier.

sinclairpaul commented 2 years ago

I tested this as well and couldn't duplicate, although I must say I'm not a huge Grafana user, so may be something to do with how you use the renderer??

However, yeah the library reports as missing:

root@a0d7b954-grafana:/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux# ldd chrome | grep not
        libxshmfence.so.1 => not found

Looks like we need to add libxshmfence1, will do a PR when I have a few minutes.

debsahu commented 2 years ago

I use it with camera component

camera:
  - platform: generic
    name: Grafana_2_water_consumption
    still_image_url: http://a0d7b954-grafana/api/hassio_ingress/XXXXXXXXXXXX/render/d-solo/IPOUl8lZk/rtlamr?orgId=1&panelId=6&width=600&height=300&tz=America%2FNew_York
    username: !secret grafana_user
    password: !secret grafana_pass
    verify_ssl: false
debsahu commented 2 years ago

Thanks, this fixed it.