Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeJS and Grafana issue #412

Closed
manymoji opened this issue Mar 21, 2023 · 1 comment
Closed

NodeJS and Grafana issue #412

manymoji opened this issue Mar 21, 2023 · 1 comment

Comments

@manymoji
Copy link

manymoji commented Mar 21, 2023

Environment:

  • Grafana Image Renderer version:3.6.4
  • Grafana version: 4.3.2

I try to use nodeJS (install with Grafana renderer) and Grafana in same docker compose

but i got this error message

6649430&panelId=123125&width=1000&height=500&tz=Asia%2FBangkok"
test-grafana-1  | logger=rendering renderer=http t=2023-03-21T16:53:59.798558292Z level=debug msg="calling remote rendering service" url="http://nodejs:8081/render?deviceScaleFactor=1.000000&domain=localhost&encoding=&height=500&renderKey=D3QzFxLBWMK8gn2xpgJWqpaIoQIhKPxF&timeout=60&timezone=Asia%2FBangkok&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FDoppio%2Fnekomarket-subprojectname%3ForgId%3D1%26from%3D1679395049430%26to%3D1679416649430%26panelId%3D123125%26width%3D1000%26height%3D500%26tz%3DAsia%252FBangkok%26render%3D1&width=1000"
test-nodejs-1   | {"failure":"net::ERR_CONNECTION_REFUSED","level":"error","message":"Browser request failed","method":"GET","url":"http://localhost:3000/d-solo/Doppio/nekomarket-subprojectname?orgId=1&from=1679395049430&to=1679416649430&panelId=123125&width=1000&height=500&tz=Asia%2FBangkok&render=1"}
test-nodejs-1   | {"err":"Error: net::ERR_CONNECTION_REFUSED at http://localhost:3000/d-solo/Doppio/nekomarket-subprojectname?orgId=1&from=1679395049430&to=1679416649430&panelId=123125&width=1000&height=500&tz=Asia%2FBangkok&render=1\n    at navigate (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Frame.js:225:23)\n    at processTicksAndRejections (node:internal/process/task_queues:96:5)\n    at async Frame.goto (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Frame.js:195:21)\n    at async Page.goto (/usr/src/app/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:1155:16)\n    at async Browser.takeScreenshot (/usr/src/app/build/browser/browser.js:261:13)\n    at async Browser.render (/usr/src/app/build/browser/browser.js:235:20)\n    at async HttpServer.render (/usr/src/app/build/service/http-server.js:53:28)","level":"error","message":"Error while trying to prepare page for screenshot","url":"http://localhost:3000/d-solo/Doppio/nekomarket-subprojectname?orgId=1&from=1679395049430&to=1679416649430&panelId=123125&width=1000&height=500&tz=Asia%2FBangkok&render=1"}

Screenshot 2566-03-21 at 23 56 54

But i run with standalone outside from docker it works
not sure what going on docker

@Clarity-89
Copy link
Contributor

It looks like the renderer is attempting to connect to Grafana using localhost, which does not work in a containerized environment because each container has its own network namespace. You need to update your Grafana configuration to point to the correct Grafana server:

[remote_rendering]
url = http://<grafana_container_name>:3000

Replace <grafana_container_name> with the name of the Grafana container in your Docker Compose configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants