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

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.

By default NGINX disconnects after one or two minutes (check the default values of these parameters) when there is no activity. As it is not guaranteed that you will receive or send a LoRaWAN frame each minute, you need to set this to a high value.

I switched to NGINX quickly and applied you config. But it seems like I still have an issue with the websocket. It is still disconnected even though the browser is now answering the request via the proxy of NGINX.

Is it possible I configured something wrong with the websockets?

Hi Brocaar,

I made it. I had to play around a bit but I finally got it working with apache. I had two issues, first thing I had to do is to upgrade my apache because it is still a 2.22 so I had to follow these two threads:

After that I had to try a little and got it running with the final setting for the apache proxy as following:

#############
### Proxy ###
#############

ProxyRequests off
ProxyPreserveHost on

ProxyPassMatch ^/api/(gateways|devices)/(\w+)/(frames|events)$ wss://localhost:8080/api/$1/$2/$3
ProxyPass / https://localhost:8080/
ProxyPassReverse / https://localhost:8080/

<Proxy *>
Order allow,deny
Allow from all
</Proxy>

So, now the journey can countinue.

Best regards,

Lu Wi

1 Like