2022-05-26 23:06:25 +08:00
---
aliases:
2022-12-10 00:36:04 +08:00
- ../../image-rendering/troubleshooting/
2022-05-26 23:06:25 +08:00
description: Image rendering troubleshooting
keywords:
- grafana
- image
- rendering
- plugin
- troubleshooting
Explicitly set all front matter labels in the source files (#71548)
* Set every page to have defaults of 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/enterprise-licensing pages to have 'Enterprise' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/recorded-queries pages to have labels cloud,enterprise
* Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set administration/stats-and-license pages to have labels cloud,enterprise
* Set alerting pages to have labels cloud,enterprise,oss
* Set breaking-changes pages to have labels cloud,enterprise,oss
* Set dashboards pages to have labels cloud,enterprise,oss
* Set datasources pages to have labels cloud,enterprise,oss
* Set explore pages to have labels cloud,enterprise,oss
* Set fundamentals pages to have labels cloud,enterprise,oss
* Set introduction/grafana-cloud pages to have labels cloud
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Fix introduction pages products
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set panels-visualizations pages to have labels cloud,enterprise,oss
* Set release-notes pages to have labels cloud,enterprise,oss
* Set search pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss
* Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise
* Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
* Set troubleshooting pages to have labels cloud,enterprise,oss
* Set whatsnew pages to have labels cloud,enterprise,oss
* Apply updated labels from review
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
---------
Signed-off-by: Jack Baldry <jack.baldry@grafana.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 16:10:12 +08:00
labels:
products:
- enterprise
- oss
2023-05-18 22:50:20 +08:00
menuTitle: Troubleshooting
title: Troubleshoot image rendering
2022-06-03 00:57:22 +08:00
weight: 200
2022-05-26 23:06:25 +08:00
---
2019-09-18 01:24:03 +08:00
2021-09-16 21:53:43 +08:00
# Troubleshoot image rendering
2019-09-18 01:24:03 +08:00
2021-09-16 21:53:43 +08:00
In this section, you'll learn how to enable logging for the image renderer and you'll find the most common issues.
2021-03-23 21:24:22 +08:00
2021-09-16 21:53:43 +08:00
## Enable debug logging
2019-09-18 01:24:03 +08:00
2021-09-16 21:53:43 +08:00
To troubleshoot the image renderer, different kind of logs are available.
2019-09-18 01:24:03 +08:00
2021-09-16 21:53:43 +08:00
You can enable debug log messages for rendering in the Grafana configuration file and inspect the Grafana server logs.
2019-11-22 01:05:26 +08:00
```bash
[log]
filters = rendering:debug
```
2025-03-06 20:59:08 +08:00
You can also enable more logs in image renderer service itself by enabling [debug logging ](#enable-debug-logging ).
2021-09-16 21:53:43 +08:00
## Missing libraries
2019-11-22 01:05:26 +08:00
The plugin and rendering service uses [Chromium browser ](https://www.chromium.org/ ) which depends on certain libraries.
If you don't have all of those libraries installed in your system you may encounter errors when trying to render an image, e.g.
```bash
Rendering failed: Error: Failed to launch chrome!/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome:
error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md
```
2021-08-06 21:52:36 +08:00
In general you can use the [`ldd` ](<https://en.wikipedia.org/wiki/Ldd_(Unix )>) utility to figure out what shared libraries
2020-02-11 23:38:13 +08:00
are not installed in your system:
2019-11-22 01:05:26 +08:00
```bash
2020-02-11 23:38:13 +08:00
cd < grafana-image-render plugin directory >
2024-12-06 04:49:37 +08:00
ldd chrome-headless-shell/linux-132.0.6781.0/chrome-headless-shell-linux64/chrome-headless-shell
2020-02-11 23:38:13 +08:00
linux-vdso.so.1 (0x00007fff1bf65000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2047945000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2047924000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f204791a000)
libX11.so.6 => not found
libX11-xcb.so.1 => not found
libxcb.so.1 => not found
libXcomposite.so.1 => not found
2019-11-22 01:05:26 +08:00
...
```
2025-07-24 22:07:44 +08:00
You can find a reference to all the relevant Debian packages for the service to function [in the Dockerfile ](https://github.com/grafana/grafana-image-renderer/blob/master/Dockerfile ).
If you are using an operating system that is not Debian 12, you should look up what each of those packages are called on your system.
2024-09-30 15:58:52 +08:00
2021-09-16 21:53:43 +08:00
## Certificate signed by internal certificate authorities
2020-01-27 20:57:50 +08:00
2020-09-25 21:57:03 +08:00
In many cases, Grafana runs on internal servers and uses certificates that have not been signed by a CA ([Certificate Authority](https://en.wikipedia.org/wiki/Certificate_authority)) known to Chrome, and therefore cannot be validated. Chrome internally uses NSS ([Network Security Services](https://en.wikipedia.org/wiki/Network_Security_Services)) for cryptographic operations such as the validation of certificates.
2020-01-27 20:57:50 +08:00
2020-02-11 23:38:13 +08:00
If you are using the Grafana Image Renderer with a Grafana server that uses a certificate signed by such a custom CA (for example a company-internal CA), rendering images will fail and you will see messages like this in the Grafana log:
2020-01-27 20:57:50 +08:00
```
t=2019-12-04T12:39:22+0000 lvl=error msg="Render request failed" logger=rendering error=map[] url="https://192.168.106.101:3443/d-solo/zxDJxNaZk/graphite-metrics?orgId=1& refresh=1m& from=1575438321300& to=1575459921300& var-Host=master1& panelId=4& width=1000& height=500& tz=Europe%2FBerlin& render=1" timestamp=0001-01-01T00:00:00.000Z
t=2019-12-04T12:39:22+0000 lvl=error msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: net::ERR_CERT_AUTHORITY_INVALID at https://192.168.106.101:3443/d-solo/zxDJxNaZk/graphite-metrics?orgId=1& refresh=1m& from=1575438321300& to=1575459921300& var-Host=master1& panelId=4& width=1000& height=500& tz=Europe%2FBerlin& render=1"
t=2019-12-04T12:39:22+0000 lvl=error msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/zxDJxNaZk/graphite-metrics status=500 remote_addr=192.168.106.101 time_ms=310 size=1722 referer="https://grafana.xxx-xxx/d/zxDJxNaZk/graphite-metrics?orgId=1& refresh=1m"
```
If this happens, then you have to add the certificate to the trust store. If you have the certificate file for the internal root CA in the file `internal-root-ca.crt.pem` , then use these commands to create a user specific NSS trust store for the Grafana user (`grafana` for the purpose of this example) and execute the following steps:
2021-09-16 21:53:43 +08:00
**Linux:**
```
[root@server ~]# [ -d /usr/share/grafana/.pki/nssdb ] || mkdir -p /usr/share/grafana/.pki/nssdb
2023-04-26 03:13:26 +08:00
[root@server ~]# certutil -d sql:/usr/share/grafana/.pki/nssdb -A -n internal-root-ca -t C -i /etc/pki/tls/certs/internal-root-ca.crt.pem
2020-01-27 20:57:50 +08:00
[root@server ~]# chown -R grafana: /usr/share/grafana/.pki/nssdb
```
2020-02-11 23:38:13 +08:00
2025-07-24 22:07:44 +08:00
You may also have to use other tooling than `certutil` , such as `update-ca-certificates` and its accompanying paths.
This depends on the Linux distribution you use; distributions often have a wiki with this type of information.
2021-09-16 21:53:43 +08:00
**Windows:**
```
certutil – addstore "Root" < path > /internal-root-ca.crt.pem
```
2024-09-27 20:00:57 +08:00
**Container:**
```Dockerfile
FROM grafana/grafana-image-renderer:latest
2025-07-24 22:07:44 +08:00
# Elevate our permissions to access system resources.
2024-09-27 20:00:57 +08:00
USER root
2025-07-24 22:07:44 +08:00
RUN mkdir -p /usr/local/share/ca-certificates/
# Convert from .pem to .crt
RUN openssl x509 -inform PEM -in rootCA.pem -out /usr/local/share/ca-certificates/rootCA.crt
2024-09-27 20:00:57 +08:00
2025-07-24 22:07:44 +08:00
# Regenerate the CA certificates in the container.
RUN update-ca-certificates --fresh
2024-09-27 20:00:57 +08:00
2025-07-24 22:07:44 +08:00
# Reassume the nonroot user for the service execution.
USER nonroot
2025-07-28 18:21:41 +08:00
# Some CA certificates also need to explicitly be included in the user's network security services database.
# certutil is shipped in v4.0.8 and onwards of the image.
RUN mkdir -p /home/nonroot/.pki/nssdb
RUN certutil -d sql:/home/nonroot/.pki/nssdb -A -n internal-root-ca -t C -i /usr/local/share/ca-certificates/rootCA.crt
2024-09-27 20:00:57 +08:00
```
2025-07-24 22:07:44 +08:00
{{< admonition type = "note" > }}
The container image was based on Alpine until v4.0.0.
After this point, it is based on distroless Debian.
{{< / admonition > }}
2021-09-16 21:53:43 +08:00
## Custom Chrome/Chromium
2020-02-11 23:38:13 +08:00
As a last resort, if you already have [Chrome ](https://www.google.com/chrome/ ) or [Chromium ](https://www.chromium.org/ )
2023-05-18 22:50:20 +08:00
installed on your system, then you can configure the Grafana Image renderer plugin to use this
2020-02-11 23:38:13 +08:00
instead of the pre-packaged version of Chromium.
2025-06-20 00:31:13 +08:00
{{< admonition type = "note" > }}
2023-05-23 04:45:28 +08:00
Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not
compatible with the [Grafana Image renderer plugin ](/grafana/plugins/grafana-image-renderer ).
2025-06-20 00:31:13 +08:00
{{< / admonition > }}
2020-02-11 23:38:13 +08:00
2021-09-16 21:53:43 +08:00
To override the path to the Chrome/Chromium executable in plugin mode, set an environment variable and make sure that it's available for the Grafana process. For example:
2020-02-11 23:38:13 +08:00
```bash
2021-07-08 00:05:55 +08:00
export GF_PLUGIN_RENDERING_CHROME_BIN="/usr/bin/chromium-browser"
2020-02-11 23:38:13 +08:00
```
2021-09-16 21:53:43 +08:00
In remote rendering mode, you need to set the environment variable or update the configuration file and make sure that it's available for the image rendering service process:
```bash
CHROME_BIN="/usr/bin/chromium-browser"
```
```json
{
"rendering": {
"chromeBin": "/usr/bin/chromium-browser"
}
}
```