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

Streaming is not working? Have to manually refresh #20

Closed
victorclaessen opened this issue Aug 18, 2021 · 10 comments
Closed

Streaming is not working? Have to manually refresh #20

victorclaessen opened this issue Aug 18, 2021 · 10 comments

Comments

@victorclaessen
Copy link

Hi, from the animated GIF in the README I got the impression that a panel using the MQTT data would auto update as new data came in. I was hoping to use this to show my data at 10 Hz which the normal refresh method does not support.

However, for me, the panel does not auto update as in the README GIF. Do I have to activate that somewhere? I do to see all datapoints (10 are published each second) when I manually refresh or set the dashboard refresh to 1s. But then the whole dashboard updates at 1 Hz and it just fills in 10 datapoints at a time, and not 1 datapoint every 100ms, as I had hoped.

Do I have to activate streaming somewhere? Or am I missing something?

Grafana 8.1.1 on Debian 11, used the Ubuntu steps from the README to install the plugin. That seems to have worked at least.

@atifali
Copy link
Contributor

atifali commented Aug 21, 2021

thank you for raising this issue.

can you provide some more details about your MQTT setup, as in the broker side and where the messages are being published on the topic etc?

have you given the dummy MQTT test broker a try yet? its here: https://github.com/grafana/mqtt-datasource/blob/main/test_broker.js

you can run that by installing NodeJS and then running this from root of this repo:

node test_broker.js

@victorclaessen
Copy link
Author

victorclaessen commented Aug 22, 2021

I'm currently using the EMQx broker. I'm publishing floats (via MQTT they are always in the form of strings, but without quotes or other decoration) on topic FELIX/powermeter/shot/estimated_power. With MQTT Explorer or mosquitto_sub I see the messages appearing. As mentioned, all the values show up in the grafana graph when I refresh manually, so they are obviously arriving.

I am willing to try another broker, though I do not expect that to make a difference. However, that will have to wait two weeks due to holidays.

@atifali
Copy link
Contributor

atifali commented Aug 25, 2021

hmm - can you show me what the message looks like exactly? i think it has to do with how your message is formatted and is being received by the frontend. thank you for the details 🙂

@sommbeer
Copy link

I had the exact same issue with Grafana v8.1.2, running in Docker container. Is the grafana Live testdata stream working on your side?
In my case this was not working too, so I assumed it was a general Grafana Live issue.
The solution which worked for me is described here: grafana/grafana#36929

@HenrikRolandHansen
Copy link

Running a Mosquitto Broker(v3.1.1) on a Raspberry pi and I'm also not able to make the data stream by it self. Only setting the refresh rate updates the MQTT data in grafana.

@sommbeer
Copy link

Can you check the Grafana Log? Are there any error messages?

@HenrikRolandHansen
Copy link

This is a copy from the log. I notice a lot of "Request Origin is not authorized" that I do not know if is due to the MQTT.

t=2021-08-27T19:17:23+0200 lvl=info msg="Starting Grafana" logger=server version=8.1.2 commit=103f8fa094 branch=HEAD compiled=2021-08-19T20:19:17+0200
t=2021-08-27T19:17:23+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2021-08-27T19:17:23+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2021-08-27T19:17:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2021-08-27T19:17:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2021-08-27T19:17:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2021-08-27T19:17:23+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2021-08-27T19:17:23+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2021-08-27T19:17:23+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2021-08-27T19:17:23+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2021-08-27T19:17:23+0200 lvl=info msg="Path Plugins" logger=settings path=/home/plugins
t=2021-08-27T19:17:23+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2021-08-27T19:17:23+0200 lvl=info msg="App mode production" logger=settings
t=2021-08-27T19:17:23+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=22302
t=2021-08-27T19:17:23+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2021-08-27T19:17:23+0200 lvl=info msg="Starting DB migrations" logger=migrator
t=2021-08-27T19:17:23+0200 lvl=info msg="migrations completed" logger=migrator performed=0 skipped=330 duration=3.094422ms
t=2021-08-27T19:17:23+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2021-08-27T19:17:24+0200 lvl=info msg="Registering plugin" logger=plugins id=input
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=ae3e-plotly-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-worldmap-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=marcusolsson-json-datasource
t=2021-08-27T19:17:29+0200 lvl=warn msg="Running an unsigned plugin" logger=plugins pluginID=grafana-mqtt-datasource pluginDir=/home/plugins/mqtt-datasource/dist
t=2021-08-27T19:17:29+0200 lvl=info msg=Profiler logger=plugins.backend pluginId=grafana-mqtt-datasource enabled=false
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-mqtt-datasource
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=natel-discrete-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=snuids-radar-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=speakyourcode-button-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=cloudspout-button-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-simple-json-datasource
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=petrslavotinek-carpetplot-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=pierosavi-imageit-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=ryantxu-ajax-panel
t=2021-08-27T19:17:29+0200 lvl=info msg="Registering plugin" logger=plugins id=simpod-json-datasource
t=2021-08-27T19:17:29+0200 lvl=info msg="Live Push Gateway initialization" logger=live.push_http
t=2021-08-27T19:17:29+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=192.168.1.60:3000 protocol=http subUrl= socket=
t=2021-08-27T19:17:29+0200 lvl=info msg="MQTT Connecting" logger=plugins.backend pluginId=grafana-mqtt-datasource
t=2021-08-27T19:17:33+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:17:33+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:17:37+0200 lvl=info msg="MQTT Connecting" logger=plugins.backend pluginId=grafana-mqtt-datasource
t=2021-08-27T19:17:48+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:17:48+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:18:02+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:18:02+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=1 size=10 referer=
t=2021-08-27T19:18:19+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:18:19+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=5 size=10 referer=
t=2021-08-27T19:18:30+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:18:30+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:18:48+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:18:48+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=15 size=10 referer=
t=2021-08-27T19:19:03+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:19:03+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:19:22+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:19:22+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:19:34+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:19:34+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:19:52+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:19:52+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=4 size=10 referer=
t=2021-08-27T19:20:11+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:20:11+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=1 size=10 referer=
t=2021-08-27T19:20:26+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:20:26+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:20:42+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:20:43+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=14 size=10 referer=
t=2021-08-27T19:21:01+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:21:01+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:21:21+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:21:21+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=1 size=10 referer=
t=2021-08-27T19:21:35+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:21:35+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:21:50+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:21:51+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=13 size=10 referer=
t=2021-08-27T19:22:09+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:22:09+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:22:30+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:22:30+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=7 size=10 referer=
t=2021-08-27T19:22:40+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:22:40+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:22:51+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:22:52+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=15 size=10 referer=
t=2021-08-27T19:23:11+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:23:11+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=1 size=10 referer=
t=2021-08-27T19:23:27+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:23:27+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:23:47+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:23:47+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=4 size=10 referer=
t=2021-08-27T19:24:06+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:24:06+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=150 size=10 referer=
t=2021-08-27T19:24:20+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:24:20+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:24:36+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:24:36+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:24:51+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:24:51+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:25:09+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:25:09+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=138 size=10 referer=
t=2021-08-27T19:25:21+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:25:21+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:25:38+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:25:38+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:25:53+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:25:53+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:26:06+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:26:06+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=4 size=10 referer=
t=2021-08-27T19:26:21+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:26:22+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=13 size=10 referer=
t=2021-08-27T19:26:41+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:26:41+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:27:00+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:27:00+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:27:18+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:27:18+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=4 size=10 referer=
t=2021-08-27T19:27:28+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:27:29+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=16 size=10 referer=
t=2021-08-27T19:27:47+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:27:47+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=4 size=10 referer=
t=2021-08-27T19:28:03+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:28:03+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:28:17+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:28:17+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=6 size=10 referer=
t=2021-08-27T19:28:27+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:28:27+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:28:47+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:28:47+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=17 size=10 referer=
t=2021-08-27T19:28:57+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:28:57+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:29:18+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:18+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=15 size=10 referer=
t=2021-08-27T19:29:29+0200 lvl=info msg="Shutdown started" logger=server reason="System signal: terminated"
t=2021-08-27T19:29:29+0200 lvl=info msg="Starting Grafana" logger=server version=8.1.2 commit=103f8fa094 branch=HEAD compiled=2021-08-19T20:19:17+0200
t=2021-08-27T19:29:29+0200 lvl=info msg="Config loaded from" logger=settings file=/usr/share/grafana/conf/defaults.ini
t=2021-08-27T19:29:29+0200 lvl=info msg="Config loaded from" logger=settings file=/etc/grafana/grafana.ini
t=2021-08-27T19:29:29+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.data=/var/lib/grafana"
t=2021-08-27T19:29:29+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.logs=/var/log/grafana"
t=2021-08-27T19:29:29+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.plugins=/var/lib/grafana/plugins"
t=2021-08-27T19:29:29+0200 lvl=info msg="Config overridden from command line" logger=settings arg="default.paths.provisioning=/etc/grafana/provisioning"
t=2021-08-27T19:29:29+0200 lvl=info msg="Path Home" logger=settings path=/usr/share/grafana
t=2021-08-27T19:29:29+0200 lvl=info msg="Path Data" logger=settings path=/var/lib/grafana
t=2021-08-27T19:29:29+0200 lvl=info msg="Path Logs" logger=settings path=/var/log/grafana
t=2021-08-27T19:29:29+0200 lvl=info msg="Path Plugins" logger=settings path=/home/plugins
t=2021-08-27T19:29:29+0200 lvl=info msg="Path Provisioning" logger=settings path=/etc/grafana/provisioning
t=2021-08-27T19:29:29+0200 lvl=info msg="App mode production" logger=settings
t=2021-08-27T19:29:29+0200 lvl=info msg="Writing PID file" logger=server path=/var/run/grafana/grafana-server.pid pid=22661
t=2021-08-27T19:29:29+0200 lvl=info msg="Connecting to DB" logger=sqlstore dbtype=sqlite3
t=2021-08-27T19:29:29+0200 lvl=info msg="Starting DB migrations" logger=migrator
t=2021-08-27T19:29:29+0200 lvl=info msg="migrations completed" logger=migrator performed=0 skipped=330 duration=2.747668ms
t=2021-08-27T19:29:29+0200 lvl=info msg="Starting plugin search" logger=plugins
t=2021-08-27T19:29:29+0200 lvl=info msg="Registering plugin" logger=plugins id=input
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-simple-json-datasource
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=marcusolsson-json-datasource
t=2021-08-27T19:29:35+0200 lvl=warn msg="Running an unsigned plugin" logger=plugins pluginID=grafana-mqtt-datasource pluginDir=/home/plugins/mqtt-datasource/dist
t=2021-08-27T19:29:35+0200 lvl=info msg=Profiler logger=plugins.backend pluginId=grafana-mqtt-datasource enabled=false
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-mqtt-datasource
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=petrslavotinek-carpetplot-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=pierosavi-imageit-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=simpod-json-datasource
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=speakyourcode-button-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=ae3e-plotly-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=cloudspout-button-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=grafana-worldmap-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=natel-discrete-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=ryantxu-ajax-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Registering plugin" logger=plugins id=snuids-radar-panel
t=2021-08-27T19:29:35+0200 lvl=info msg="Live Push Gateway initialization" logger=live.push_http
t=2021-08-27T19:29:35+0200 lvl=info msg="HTTP Server Listen" logger=http.server address=192.168.1.60:3000 protocol=http subUrl= socket=
t=2021-08-27T19:29:35+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:35+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:29:36+0200 lvl=eror msg="Request error" logger=context userId=1 orgId=1 uname=admin error="net/http: abort Handler"
t=2021-08-27T19:29:36+0200 lvl=info msg="MQTT Connecting" logger=plugins.backend pluginId=grafana-mqtt-datasource
t=2021-08-27T19:29:36+0200 lvl=info msg="MQTT Connecting" logger=plugins.backend pluginId=grafana-mqtt-datasource
t=2021-08-27T19:29:42+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:42+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=
t=2021-08-27T19:29:44+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:44+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:29:46+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:46+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:29:51+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:29:51+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=12 size=10 referer=
t=2021-08-27T19:30:06+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:30:06+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:30:21+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:30:21+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=1 size=10 referer=
t=2021-08-27T19:30:36+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:30:36+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=3 size=10 referer=
t=2021-08-27T19:30:52+0200 lvl=warn msg="Request Origin is not authorized" logger=live origin=http://192.168.1.60:3000 appUrl=http://localhost:3000/ allowedOrigins=
t=2021-08-27T19:30:52+0200 lvl=info msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/api/live/ws status=403 remote_addr=192.168.1.158 time_ms=2 size=10 referer=

@sommbeer
Copy link

Ok thank you. I got the same messages. It is not caused by MQTT, but by the HTTP Requests, performed by the Live panels. This HTTP request fails status exit code 403 (forbidden). This is because Grafana checks the Origin of the HTTP request to match the root_url value from the configuration.
The issue is also described in the issue, I mentioned above.

So now you have 2 possibilities. You have to change a parameter in the Grafana configuration file. ( see the Docs https://grafana.com/docs/grafana/latest/administration/configuration/ )

I have to say, that I am also not an expert in HTTP and am currently not 100% sure as there are also some other IP-addresses and localhost mentioned above. So if this does not work, you can maybe try a list of the options. Probably the easiest way is to use a wildcard, by setting allowed_origins=*. This should allow every origin, but surely is less secure.

@HenrikRolandHansen
Copy link

That did the trick thanks a lot. :)

Now I only have to manage the MQTT topic that Grafana live don't seam to like due to spaces or Danish special letters eg æ, Ø Å.

Invalid channel ID" logger=live user=1 client=adc1ca40-15a4-424d-a341-5afc7e234901 channel="1/ds/Y1apShRRk/Værelse mor

cheers

@victorclaessen
Copy link
Author

Ok, back from holiday. Good to see a lot of activity on this issue.

Ok, so by now it seemed clear it was not a broker issue, but rather a web issue. I was not seeing any of the "Request Origin is not authorized" messages described above, so in my case that was not the problem.

While trying another browser (Chrome instead of Firefox) I noticed that I also had the same error messages in the console as linked from this #20 (comment), i.e. websocket connection failed.

I now realised there was an apache2 reverse proxy in between that was not handling the websocket connection right. I am serving grafana in the virtual path /grafana on my server. This is the relevant piece of my apache2 configuration:

    # reverse proxy for grafana
    ProxyPass /grafana/ http://localhost:3000/
    ProxyPassReverse /grafana/ http://localhost:3000/
    Redirect        "/grafana"  "/grafana/"

Reading from grafana/grafana#36929 (comment) I managed to make it work by enabling mod_rewrite and adding these lines to the apache2 configuration:

    RewriteEngine On
    RewriteCond %{HTTP:Upgrade} =websocket [NC]
    RewriteRule /grafana/(.*)           ws://localhost:3000/$1 [P,L]

Thanks to all for your help!

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

4 participants