grafana-image-renderer icon indicating copy to clipboard operation
grafana-image-renderer copied to clipboard

AnnotationSrv.query error JSHandle

Open nechry opened this issue 3 years ago • 2 comments

What happened: Every time I call the renderer theres errors log shows:

t=2021-08-19T07:56:12+0000 lvl=eror msg="Browser console error" logger=plugins.backend pluginId=grafana-image-renderer msg="AnnotationSrv.query error JSHandle@error" url=https://localhost/public/build/app.843e85298b12060ea650.js line=4716.000 column=9599.000
t=2021-08-19T07:56:13+0000 lvl=eror msg="Browser console error" logger=plugins.backend pluginId=grafana-image-renderer msg="WebSocket connection to 'wss://localhost/api/live/ws' failed: Error during WebSocket handshake: Unexpected response code: 403" url=https://localhost/public/build/vendors~app.843e85298b12060ea650.js line=1.000

no valid certificat for url=https://localhost/ or wss://localhost/api/live/ws

What you expected to happen: not error in log file

How to reproduce it (as minimally and precisely as possible): call the renderer url https://myDNS.name/render/d/AAjBh_1Zk/dashboardName?orgId=1&width=770&height=420&kiosk

Anything else we need to know?: Grafana is configure with ssl, some grafana.ini

protocol = https
http_port = 443
domain = myDNS.name
enforce_domain = true # same with false

Environment:

  • Grafana Image Renderer version: 3.0.1
  • Grafana version: 8.1.1
  • Installed plugin or remote renderer service: installed plugin, no overide config
  • OS Grafana Image Renderer is installed on: Ubuntu 18
  • User OS & Browser: Windows10 with Chrome
  • Others: no error with version 7 before update in 8.

nechry avatar Aug 19 '21 13:08 nechry

Hello! Did you change your setup between Grafana 7 and 8? It seems a lot like this issue but this was present in Grafana 7 as well: https://github.com/grafana/grafana-image-renderer/issues/191

As mentioned in the issue above, you need to set http_addr in your Grafana config file for the renderer plugin to call the right URL for Grafana.

AgnesToulet avatar Sep 06 '21 12:09 AgnesToulet

Hello @AgnesToulet, no I did not change my setup / configuration from Grafana 7 to 8, I only updated. But I think my previous version of grafana is 7.2 not 7.3

I add my local IP address to the http_addr as you mention in the server section of my Grafana config file, now I got this:

t=2021-09-07T06:22:13+0000 lvl=eror msg="Browser console error" logger=plugins.backend pluginId=grafana-image-renderer msg="WebSocket connection to 'wss://10.1.0.8/api/live/ws' failed: Error during WebSocket handshake: Unexpected response code: 403" url=https://10.1.0.8/public/build/vendors~app.8ea303538f79ee32b68a.js line=1.000
t=2021-09-07T06:22:13+0000 lvl=eror msg="Browser console error" logger=plugins.backend pluginId=grafana-image-renderer column=9599.000 msg="AnnotationSrv.query error JSHandle@error" url=https://10.1.0.8/public/build/app.8ea303538f79ee32b68a.js line=4723.000

nechry avatar Sep 07 '21 06:09 nechry

As mentioned, the fix here would be to add http_addr to the Grafana config:

protocol = https
http_port = 443
http_addr = myDNS.name # Add this line
domain = myDNS.name

Regarding the errors you're seeing in the logs, they are not related to the image-renderer, but are forwarded from the browser, so they are related to your Grafana setup.

Clarity-89 avatar Aug 03 '23 07:08 Clarity-89