You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My workplace want the image renderer to be installed alongside Grafana in an AlpineLinux-based Docker container. This is very similar to what Grafana do in their own containers, so should be a supported and working configuration.
When doing this, the renderer plug-in starts, but then fails to find Chromium. No images are being rendered.
What you expected to happen:
I expected it to render images (like it says on the tin).
How to reproduce it (as minimally and precisely as possible):
We use supervisord in an AlpineLinux container to launch the plug-in…
There are other steps like creating a grafana user (with a fixed UID/GID), importing a pre-built Grafana binary and its front-end, but that's the gist of how the image renderer plug-in is installed. supervisord then launches it with this command:
Grafana itself is working just fine (all functions except exporting a rendered image of a dashboard work). Exporting a rendering image fails.
The log message I get is:
{"level":"error","message":"Request failed","stack":"Error: Could not find Chrome (ver. 116.0.5845.96). This can occur if either\n 1. you did not perform an installation before running the script (e.g. `npm install`) or\n 2. your cache path is incorrectly configured (which is: /home/grafana/.cache/puppeteer).\nFor (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.\n at ChromeLauncher.resolveExecutablePath (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:300:27)\n at ChromeLauncher.executablePath (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:180:25)\n at ChromeLauncher.computeLaunchArguments (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:97:37)\n at async ChromeLauncher.launch (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:79:28)\n at async Browser.render (/opt/grafana-image-renderer/build/browser/browser.js:227:23)\n at async HttpServer.render (/opt/grafana-image-renderer/build/service/http-server.js:53:28)","url":"/render?deviceScaleFactor=1.000000&domain=localhost&encoding=&height=500&renderKey=Nh8z0RtEtlUZrsa28cw3OCakuYPPdNaY&timeout=60&timezone=Australia%2FBrisbane&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FrErn5j0Sk%2Fm-bus-data%3ForgId%3D1%26from%3D1712141474590%26to%3D1713265796668%26panelId%3D2%26width%3D1000%26height%3D500%26tz%3DAustralia%252FBrisbane%26render%3D1&width=1000"}
De-JSON-ifying the stack:
Error: Could not find Chrome (ver. 116.0.5845.96). This can occur if either
1. you did not perform an installation before running the script (e.g. `npm install`) or
2. your cache path is incorrectly configured (which is: /home/grafana/.cache/puppeteer).
For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.
at ChromeLauncher.resolveExecutablePath (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:300:27)
at ChromeLauncher.executablePath (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:180:25)
at ChromeLauncher.computeLaunchArguments (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:97:37)
at async ChromeLauncher.launch (/opt/grafana-image-renderer/node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:79:28)
at async Browser.render (/opt/grafana-image-renderer/build/browser/browser.js:227:23)
at async HttpServer.render (/opt/grafana-image-renderer/build/service/http-server.js:53:28)
Now… chromium is installed:
~ # apk list chromium
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.19/main: No such file or directory
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.19/community: No such file or directory
chromium-124.0.6367.78-r0 x86_64 {chromium} (BSD-3-Clause) [installed]
~ # which chromium
/usr/bin/chromium
~ # which chromium-browser
/usr/bin/chromium-browser
These are shell-script wrappers, around /usr/lib/chromium/chromium, which has all its dependencies present and accounted for:
Tried using grafana-cli install grafana-image-renderer: fails and crashes Grafana because it tries to launch a binary linked against glibc not the musl C library that AlpineLinux uses.
Tried using the grafana-image-renderer package shipped by AlpineLinux: saw the above message
Tried installing grafana-image-renderer via git: saw the above message
More tinkering, it seems I have to set bothGF_PLUGIN_RENDERING_CHROME_BINANDCHROME_BIN.
Not sure if maybe process.env.CHROME_BIN can be set to process.env.GF_PLUGIN_RENDERING_CHROME_BIN before importing the underlying library to gracefully handle this… but the error message is misleading to say the least.
I'll leave this open for a bit while I test, but I think I may have found the answer to the question.
What happened:
My workplace want the image renderer to be installed alongside Grafana in an AlpineLinux-based Docker container. This is very similar to what Grafana do in their own containers, so should be a supported and working configuration.
When doing this, the renderer plug-in starts, but then fails to find Chromium. No images are being rendered.
What you expected to happen:
I expected it to render images (like it says on the tin).
How to reproduce it (as minimally and precisely as possible):
We use
supervisord
in an AlpineLinux container to launch the plug-in…Rough
Dockerfile
set-up:There are other steps like creating a
grafana
user (with a fixed UID/GID), importing a pre-built Grafana binary and its front-end, but that's the gist of how the image renderer plug-in is installed.supervisord
then launches it with this command:Anything else we need to know?:
Grafana itself is working just fine (all functions except exporting a rendered image of a dashboard work). Exporting a rendering image fails.
The log message I get is:
De-JSON-ifying the stack:
Now…
chromium
is installed:These are shell-script wrappers, around
/usr/lib/chromium/chromium
, which has all its dependencies present and accounted for:What I've tried:
grafana-cli install grafana-image-renderer
: fails and crashes Grafana because it tries to launch a binary linked againstglibc
not themusl
C library that AlpineLinux uses.grafana-image-renderer
package shipped by AlpineLinux: saw the above messagegrafana-image-renderer
viagit
: saw the above message/usr/bin/chromium-browser
to/usr/bin/chrome
(like is done in Grafana's own image renderer container): saw the above messageGF_PLUGIN_RENDERING_CHROME_BIN
as per the troubleshooting docs: saw the above messageEnvironment:
The text was updated successfully, but these errors were encountered: