grafana/grafana-image-renderer

Error "Error: Failed to launch the browser process" on the Raspberry PI 5, architecture issue?

giuliomagnifico opened this issue · 1 comments

I'm coming from a new-fresh installation from a Raspberry PI 4B to the new 5 with an NVMe drive (damn this thing is fast!), as always I've compiled the image-renderer sources, and -as always- I got the puppeteer dependency issue:

poolpeteer@0.23.3" has incorrect peer dependency "puppeteer@^13.1.1".

But despite that it should work, at least on the Raspberry PI 4B it was working, now when I try to render an image I get the error:

{"level":"error","message":"Request failed","stack":"Error: Failed to launch the browser process!\n/root/.cache/puppeteer/chrome/linux-116.0.5845.96/chrome-linux64/chrome: 3: Syntax error: \")\"

The full log

root@DietPi:~# service grafana-image-renderer status
● grafana-image-renderer.service - grafana-image-renderer
     Loaded: loaded (/etc/systemd/system/grafana-image-renderer.service; enabled; preset: enabled)
     Active: active (running) since Mon 2024-05-06 12:55:26 CEST; 8s ago
   Main PID: 17877 (node)
      Tasks: 11 (limit: 4771)
        CPU: 2.178s
     CGroup: /system.slice/grafana-image-renderer.service
             └─17877 node build/app.js server --port=8081

May 06 12:55:26 DietPi systemd[1]: Started grafana-image-renderer.service - grafana-image-renderer.
May 06 12:55:28 DietPi node[17877]: {"level":"info","message":"HTTP Server started, listening at http://localhost:8081"}
May 06 12:55:32 DietPi node[17877]: {"level":"error","message":"Request failed","stack":"Error: Failed to launch the browser process!\n/root/.cache/puppeteer/chrome/linux-116.0.5845.96/chrome-linux64/chrome: 3: Syntax error: \")\" unexpected\n\n\nTROUBLESHOOTING: https://pptr.dev/troubleshooting\n\n    at Interface.onClose (/home/dietpi/grafana/plugins/grafana-image-renderer/node_modules/puppeteer-core/node_modules/@puppeteer/browsers/lib/cjs/launch.js:277:24)\n    at Interface.emit (node:events:529:35)\n    at Interface.close (node:internal/readline/interface:534:10)\n    at Socket.onend (node:internal/readline/interface:260:10)\n    at Socket.emit (node:events:529:35)\n    at endReadableNT (node:internal/streams/readable:1400:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)","url":"/render?deviceScaleFactor=1.000000&domain=192.168.1.6&encoding=&height=500&renderKey=8Ebst7YFETRvpKXSLbfiUlPueIWjBnPp&timeout=60&timezone=Europe%2FRome&url=http%3A%2F%2F192.168.1.6%3A3001%2Fd-solo%2FFGioSdO4z31m%2Fcasa-summary%3ForgId%3D1%26refresh%3D1m%26from%3D1714906409462%26to%3D1714992809462%26panelId%3D87%26width%3D1000%26height%3D500%26tz%3DEurope%252FRome%26render%3D1&width=1000"}
May 06 12:55:32 DietPi node[17877]: {"level":"error","message":"::ffff:192.168.1.6 - - [06/May/2024:10:55:32 +0000] \"GET /render?deviceScaleFactor=1.000000&domain=192.168.1.6&encoding=&height=500&renderKey=8Ebst7YFETRvpKXSLbfiUlPueIWjBnPp&timeout=60&timezone=Europe%2FRome&url=http%3A%2F%2F192.168.1.6%3A3001%2Fd-solo%2FFGioSdO4z31m%2Fcasa-summary%3ForgId%3D1%26refresh%3D1m%26from%3D1714906409462%26to%3D1714992809462%26panelId%3D87%26width%3D1000%26height%3D500%26tz%3DEurope%252FRome%26render%3D1&width=1000 HTTP/1.1\" 500 96 \"-\" \"Grafana/10.4.2\"\n"}
root@DietPi:~# 

And from Grafana.log

logger=rendering renderer=http t=2024-05-06T12:55:32.515480747+02:00 level=info msg=Rendering path="d-solo/FGioSdO4z31m/casa-summary?orgId=1&refresh=1m&from=1714906409462&to=1714992809462&panelId=87&width=1000&height=500&tz=Europe%2FRome"
logger=rendering renderer=http t=2024-05-06T12:55:32.568601627+02:00 level=error msg="Remote rendering request failed" error="500 Internal Server Error" url="http://192.168.1.6:3001/d-solo/FGioSdO4z31m/casa-summary?orgId=1&refresh=1m&from=1714906409462&to=1714992809462&panelId=87&width=1000&height=500&tz=Europe%2FRome&render=1"
logger=context userId=1 orgId=1 uname=admin t=2024-05-06T12:55:32.575927158+02:00 level=error msg="Rendering failed." error="remote rendering request failed, status code: 500, status: 500 Internal Server Error"
logger=context userId=1 orgId=1 uname=admin t=2024-05-06T12:55:32.576888546+02:00 level=error msg="Request error" error="Context.HTML - Error rendering template: error. You may need to build frontend assets \n template: error:16:42: executing \"error\" at <.Assets.Dark>: can't evaluate field Assets in type struct { Title string; AppTitle string; AppSubUrl string; ThemeType string; ErrorMsg error }" stack="github.com/grafana/grafana/pkg/web/context.go:112 (0x697472b)\ngithub.com/grafana/grafana/pkg/services/contexthandler/model/model.go:54 (0x697c52f)\ngithub.com/grafana/grafana/pkg/api/render.go:89 (0x8e0de4b)\ngithub.com/grafana/grafana/pkg/api/response/web_hack.go:40 (0x6981f67)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:131 (0x6975733)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/services/contexthandler/contexthandler.go:137 (0x8e18aeb)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/render.go:44 (0x6976243)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/macaron.go:137 (0x69757d3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/csrf/csrf.go:66 (0x8475613)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/recovery.go:180 (0x8df428b)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/loggermw/logger.go:72 (0x847651b)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/request_metrics.go:75 (0x6d7cb17)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/request_tracing.go:88 (0x8df4d47)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/middleware/requestmeta/request_metadata.go:66 (0x8e17de3)\nnet/http/server.go:2136 (0x58b9947)\ngithub.com/grafana/grafana/pkg/web/context.go:52 (0x69741d3)\ngithub.com/grafana/grafana/pkg/web/router.go:155 (0x69777f7)\ngithub.com/grafana/grafana/pkg/web/router.go:221 (0x697825b)\ngithub.com/grafana/grafana/pkg/web/macaron.go:163 (0x6975bcf)\nnet/http/server.go:2938 (0x58bc33b)\nnet/http/server.go:2009 (0x58b8737)\nruntime/asm_arm64.s:1197 (0x55cbc23)\n"
logger=context userId=1 orgId=1 uname=admin t=2024-05-06T12:55:32.576994933+02:00 level=error msg="Request Completed" method=GET path=/render/d-solo/FGioSdO4z31m/casa-summary status=500 remote_addr=192.168.1.10 time_ms=69 duration=69.652587ms size=343 referer= handler=/render/* status_source=server

The error could be because it doesn't recognize the armV8 platform and it downloads as dependecy chrome for x86? I tried to remove the .cache and re-compile it but I get always the same error, because I see:

/root/.cache/puppeteer/chrome/linux-116.0.5845.96/**chrome-linux64**/
"chrome-linux64", but it should be "chrome-linux-aarch64" o ARM64 not x86. Or is it normal?

Thanks.

Environment:

  • Grafana Image Renderer version: 3.10.3 and 3.10.4 but I tried also other 3.9 releases
  • Grafana version: Version 10.4.2 (commit: 22809dea50455ae875624827dd277b17621b4ed4, branch: HEAD)
  • Installed plugin or remote renderer service:
  • OS Grafana Image Renderer is installed on: Raspberry PI 5
  • User OS & Browser: DietPI
  • Others:

Update:

I fixed it asking on the forum: https://community.grafana.com/t/error-in-launching-grafana-image-renderer-after-switching-from-a-raspberry-pi-4-to-5/121714/5?u=giuliomagnifico

It was an architecture issue as I thought, puppeteer doesn't download the correct chrome binary (maybe because it doesn't recognize the ARMv8 architecture?). Anyway I had to do these steps:

I installed chromium

apt install chromium-browser

then I copied the executable file

/usr/bin/chromium-browser

to

/root/.cache/puppeteer/chrome/linux-116.0.5845.96/chrome-linux64/

renamed it as chrome and gave it che 755 permission.