Rpc error: code = Unauthenticated and Live Frame Logs / Live Event Disconnected

Yesterday i do clean install with loraserver-25.1 , lora-app-server-0.18.2 and lora-gateway-bridge-2.3.2
checking with journalctl showing no error on loraserver and lora-gateway-bridge, but i always get this error on lora-app-server

Apr 04 09:48:20 loraserver lora-app-server[2608]: time=“2018-04-04T09:48:20+07:00” level=info msg=“finished streaming call with code Unauthenticated” error=“rpc error: code = Unauthenticated desc = authentication failed: get token from context error: no authorization-data in metadata” grpc.code=Unauthenticated grpc.method=StreamFrameLogs grpc.service=api.Gateway grpc.start_time=“2018-04-04T09:48:20+07:00” grpc.time_ms=0.07 peer.address=“127.0.0.1:60048” span.kind=server system=grpc

also i have “Live LoRaWAN frame logs” and “Live event logs” statuses are disconnected.

How can I workaround this ? Thank you

I’m using Dragino Gateway and their Lora Shield as node here.

You see this error when the client is not authenticated / it does not send the JWT token in the request. In other words, LoRa App Server does not know who the client is and if the client granted to make this request.

See also: Search results for 'no authorization-data in metadata' - ChirpStack Community Forum

After i make jwt token from web API and paste it on loraserver.toml and lora-app-server.toml this error gone. Thank you

But still, “Live LoRaWAN frame logs” and “Live event logs” statuses are disconnected.
I also use another lora server implementation on github, and sent payload from nodes can be show up.

Any other to check again ?

Having the same issue.

Connect to server, delete some device it works.
If I leave the browser and try to do the same after some time it start to appear the error.

Seems that the key expired. We are having this issue after the update to lora-app 0.19 Never saw it before.

Browser: Chrome.

Yes, the login token expires after a while and you need to login again.

Is the LoRa App Server behind a HTTP proxy or load-balancer?

Yes, Lora App Server behind a http proxy.

Then that is probably the issue. Make sure your proxy is able to forward the websocket connections (including all the headers). I had issues when using Apache as a reverse proxy, but NGINX works fine (don’t forget to set a long timeout for the proxied requests, as else you will see disconnects after ~1 minute).

Example (adapt this to your own needs):

server {
	listen 443 ssl;
	server_name localhost;

	ssl_certificate /etc/lora-app-server/certs/http.pem;
	ssl_certificate_key /etc/lora-app-server/certs/http-key.pem;

	location ~ ^/api/(gateways|devices)/(\w+)/(frames|events)$ {
		proxy_pass https://localhost:8080/api/$1/$2/$3;
		proxy_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "Upgrade";
		proxy_read_timeout 86400s;
		proxy_send_timeout 86400s;
	}

	location / {
		proxy_pass https://localhost:8080/;
	}
}
2 Likes

Great !
Thank you so much.

1 Like

I was also experiencing the same issue and the suggested modification to the nginx config fixed the issue. Thank you!

1 Like

After one day running, i got this error on web ui

Error rpc error: code = OutOfRange desc = EOF (code: 11)

And Live frame logs become disconnected again

After one day running, i got this error on web ui
Error rpc error: code = OutOfRange desc = EOF (code: 11)
And Live frame logs become disconnected again

Resolve by restarting lora-app-server

I upgrade my LoRa app server and Loraserver today after solving pagination problem, everything working except I got error in LoRa app Server in Log file :slight_smile:
frame log time=“2018-04-12T01:07:29+05:30” level=info msg=“finished client streaming call” grpc.code=OK grpc.method=StreamFrameLogsForDevice grpc.service=ns.NetworkServer grpc.time_ms=0.033 span.kind=client system=grpc
And on web page : Error rpc error: code = OutOfRange desc = EOF (code: 11)
What is this error? Can I got some documentation where I can got meaning of this error code? What is solution of the problem?

Here is error in log:

time=“2018-04-12T08:47:12+05:30” level=error msg=“finished streaming call with code Unknown” error=EOF grpc.code=Unknown grpc.method=StreamFrameLogs grpc.service=api.Device grpc.start_time=“2018-04-12T08:46:42+05:30” grpc.time_ms=30007.48 peer.address=“127.0.0.1:43344” span.kind=server system=grpc
time=“2018-04-12T08:47:13+05:30” level=info msg=“finished client streaming call” grpc.code=OK grpc.method=StreamFrameLogsForDevice grpc.service=ns.NetworkServer grpc.time_ms=0.035 span.kind=client system=grpc

Hello,

I also get the “Live Frame Logs / Live Event Disconnected” message on the screen but there are no errors in the lora-app-server or loraserver log. How can I reconnect the services?

grafik

Best regards,

Lu Wi

Is there a (HTTP) proxy / load-balancer in front of LoRa App Server?

Hi,

now I understand what kind of proxy you are talking about. I am using apache instead of NGINX. This is the current setting. I probably have to add the location part from the above NGINX setting?

<VirtualHost *:80>
ServerAdmin hostmaster@xxx.xxx
ServerName lora.xxx.xxx
Redirect / https://lora.xxx.xxx/

<VirtualHost *:443>

    ServerName lora.xxx.xxx
    ServerAdmin hostmaster@xxx.xxx

    ProxyRequests off
    ProxyPreserveHost on
    <Proxy *>
            Order allow,deny
            Allow from all
    </Proxy>

    ProxyPass / https://localhost:8080/
    ProxyPassReverse / https://localhost:8080/

    ErrorLog /var/log/apache2/error.log
    LogLevel warn
    CustomLog /var/log/apache2/access.log combined
    ServerSignature On

    SSLEngine on
    SSLProxyEngine on #important for SSL support via proxy

    Header set Strict-Transport-Security "max-age=15552000"

    SSLCertificateFile /root/dehydrated/certs/lora.xxx.xxx/cert.pem
    SSLCertificateChainFile /root/dehydrated/certs/lora.xxx.xxx/chain.pem
    SSLCertificateKeyFile /root/dehydrated/certs/lora.xxx.xxx/privkey.pem

Best regards,

Lu Wi

As I mentioned in a message a bit up, I never got the web-sockets working with Apache. You might want to switch to NGINX. If you do get it working, please share your configuration! :slight_smile:

Under which condition will the disconnected pop up? I am trying to get more debugging input going through the logs. But I am not sure where to look.