level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
I have this error on the log. Not sure what this means or what I should do about this. Any help would be great.
Following on Orne’s response, and as I commented on Gitter, it seems you aren’t providing TLS certificate and private key in your lora-app-server conf. You need to provide TLS certificate and private key for the Api to work. Please check the “Security / TLS” section at
https://docs.loraserver.io/lora-app-server/install/config/
for instructions on how to generate certificates (use this kind of certificates for development purposes only).
Hi, trying to install and configure the lora-app-server on a Beaglebone black I have two problems one of them is the same problem posted here.
For the problem with
level=error
I have the next
systemctl start lora-app-server
journalctl -u lora-app-server -f -n 50
Aug 16 13:55:14 beaglebone systemd[1]: Started LoRa App Server.
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“starting LoRa App Server” docs=“
https://docs.loraserver.io/
” version=0.11.0
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“connecting to postgresql”
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“setup redis connection pool”
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“handler/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“connecting to network-server api” ca-cert= server=“127.0.0.1:8080” tls-cert= tls-key=
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“applying database migrations”
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“handler/mqtt: connected to mqtt broker”
Aug 16 13:55:14 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:14-05:00” level=info msg=“handler/mqtt: subscribling to tx topic” topic=“application/+/node/+/tx”
Aug 16 13:55:15 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:15-05:00” level=info msg=“migrations applied” count=0
Aug 16 13:55:15 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:15-05:00” level=info msg=“gwmigrate: migrating gateway data from LoRa Server”
Aug 16 13:55:15 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:15-05:00” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = transport is closing”
In
/etc/default/lora-app-server
I have the next configuration:
#postgresql
dsn (e.g.: postgres://user:password@hostname/database?sslmode=disable) (default: "postgres://localhost/loraserver?sslmode=disable
POSTGRES_DSN=postgres://loraappserver:dbPass@localhost/loraappserver?sslmode=disable
automatically apply database migrations
DB_AUTOMIGRATE=true
#redis
url (e.g. redis://user:password@hostname/0) (default: “redis://localhost:6379”)
REDIS_URL=redis://localhost:6379
#mqtt
server (e.g. scheme://host:port where scheme is tcp, ssl or ws) (default: “tcp://localhost:1883”)
MQTT_SERVER=tcp://localhost:1883
#mqtt
server username (optional)
MQTT_USERNAME=
#mqtt
server password (optional)
MQTT_PASSWORD=
#ca
certificate used by the api server (optional)
CA_CERT=/etc/default/certs/ca.pem
#tls
certificate used by the api server (optional)
TLS_CERT=/etc/default/certs/cert.pem
#tls
key used by the api server (optional)
TLS_KEY=/etc/default/certs/key.pem
#ip:port
to bind the api server (default: “0.0.0.0:8001”)
BIND=0.0.0.0:8001
#ip:port
to bind the (user facing) http server to (web-interface and REST / gRPC api) (default: “0.0.0.0:8080”)
HTTP_BIND=0.0.0.0:8080
#http
server TLS certificate
HTTP_TLS_CERT=/etc/lora-app-server/certs/http.pem
#http
server TLS key
HTTP_TLS_KEY=/etc/lora-app-server/certs/http-key.pem
#JWT
secret used for api authentication / authorization
#You
could generate this by executing ‘openssl rand -base64 32’ for example
JWT_SECRET=AeOMwItOBx7JCgUQnKAvL5ImI13HssW48OhCAWQ2WCw=
#hostname:port
of the network-server api server (default: “127.0.0.1:8000”)
NS_SERVER=127.0.0.1:8080
My second issue is when I have NS_SERVER with default configuration, because i got a bind error:
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“starting LoRa App Server” docs=“
https://docs.loraserver.io/
” version=0.11.0
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“connecting to postgresql”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“setup redis connection pool”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“handler/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“connecting to network-server api” ca-cert= server=“127.0.0.1:8000” tls-cert= tls-key=
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“applying database migrations”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“handler/mqtt: connected to mqtt broker”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“handler/mqtt: subscribling to tx topic” topic=“application/+/node/+/tx”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“migrations applied” count=0
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“gwmigrate: migrating gateway data from LoRa Server”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“starting application-server api” bind=“0.0.0.0:8001” ca-cert= tls-cert= tls-key=
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=info msg=“starting client api server” bind=“0.0.0.0:8080” tls-cert=“/etc/lora-app-server/certs/http.pem” tls-key=“/etc/lora-app-server/certs/http-key.pem”
Aug 16 13:26:13 beaglebone lora-app-server[5379]: time=“2017-08-16T13:26:13-05:00” level=fatal msg=“listen tcp 0.0.0.0:8080: bind: address already in use”
And if I change NS_SERVER=127.0.0.1:8080
Aug 16 13:55:16 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:16-05:00” level=info msg=“transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.”
Aug 16 13:55:16 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:16-05:00” level=info msg=“transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.”
Aug 16 13:55:16 beaglebone lora-app-server[9550]: time=“2017-08-16T13:55:16-05:00” level=info msg=“transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.”
And lora-gateway-bridge and lora-server services are up and running
I don’t know what it’s my error because i’m using default configurations for the lora services installed onto my system.
Do you have any idea about how I can fix this errors?
Thank you Brocaar,
I have done different tests changing the configuration into the configuration files.
Fisrt case:
where:
/etc/default/lorasever
NET_ID=010203
BAND=EU_863_870
#ip:port
to bind the api server (default: “0.0.0.0:8000”)
BIND=0.0.0.0:8000
It seems that currently one side of the API is using TLS where the client is not using TLS, causing the API to drop the connection(s).
The result is the same, the error remains
Aug 17 11:43:28 beaglebone lora-app-server[23974]: time=“2017-08-17T11:43:28-05:00” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
Aug 17 11:43:30 beaglebone lora-app-server[23974]: time=“2017-08-17T11:43:30-05:00” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
Aug 17 11:43:32 beaglebone lora-app-server[23974]: time=“2017-08-17T11:43:32-05:00” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
Aug 17 11:43:34 beaglebone lora-app-server[23974]: time=“2017-08-17T11:43:34-05:00” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
I don´t understand why when I have in
/etc/default/loraserver
BIND=0.0.0.0:8000
AS_SERVER=127.0.0.1:8001
/etc/default/lora-app-server
BIND=0.0.0.0:8001
NS_SERVER=127.0.0.1:8000
in lora-app-server log i have
Aug 17 08:48:24 beaglebone lora-app-server[2219]: time=“2017-08-17T08:48:24-05:00” level=fatal msg=“listen tcp 0.0.0.0:8080: bind: address already in use”
Aug 17 08:48:24 beaglebone systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
Note that the error has to do with port 8080, which should be bound to the HTTP server. Could you check if there’s another process using that port already? I.e., run this (grep port 80 instead of 8080 so you can check ports 8000 and 8001 too):
netstat -pln | grep :80
Thank you,
I checked my system and I saw that effectively there was other service that was using the port 8080.
Fixing that, I don’ have any problem when lora-app-server is started.
Thank very much for your support brocaar, iegomez
I got the same error:
raspberrypi lora-app-server[810]: time=“2017-10-24T08:59:01Z” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
I did create an image for an raspberry pi 3.
I made a config file for the IMG_NAME and rest kept as default.
I did check the configuration, it’s on 0.0.0.0:8080 and create the certificate as mentioned above.
But I am still getting the error.
systemctl start lora-app-server
I don’t get an error when I try to run the lora-app-server
systemctl start lora-app-server
journalctl -u lora-app-server -f -n 50
No journal files were found.
Do you guys have any other suggestions?
raspberrypi lora-app-server[810]: time=“2017-10-24T08:59:01Z” level=error msg=“gwmigrate: list gateways error (will retry): rpc error: code = Unavailable desc = grpc: the connection is unavailable”
The issue is probably with the
loraserver
process. Could you check if that process is running? If not and it does not start, you could run the following to start it manually to see the error (given you’re using the
.deb
package / repository):
set -a
source /etc/default/loraserver
loraserver
pi@raspberrypi:/ $ loraserver
INFO[0000] starting LoRa Server band="EU_863_870" docs= "https://docs.loraserver.io/" net_id=010203 version=0.21.0
INFO[0000] setup redis connection pool url="redis://localhost: 6379"
INFO[0000] connecting to postgresql
INFO[0000] backend/gateway: connecting to mqtt broker server="tcp://localhost :1883"
INFO[0000] backend/gateway: connected to mqtt server
INFO[0000] backend/gateway: subscribing to rx topic topic="gateway/+/rx"
INFO[0000] connecting to application-server ca-cert= server="127.0. 0.1:8001" tls-cert= tls-key=
INFO[0000] no network-controller configured
INFO[0000] applying database migrations
INFO[0000] grpc: addrConn.resetTransport failed to create client transport: conn ection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:8001: ge tsockopt: connection refused"; Reconnecting to {127.0.0.1:8001 <nil>}
INFO[0000] backend/gateway: subscribing to stats topic topic="gateway/+/stats"
INFO[0000] migrations applied count=0
INFO[0000] starting api server bind="0.0.0.0:8000" ca- cert= tls-cert= tls-key=
INFO[0000] starting gateway api server bind="0.0.0.0:8002" ca- cert= tls-cert= tls-key=
FATA[0000] --gw-server-jwt-secret must be set
Thanks this gives me an indication what the problem is.
I did set them in the loraserver and lora-app-server in scripts/default
I still get the message: FATA[0000] --gw-server-jwt-secret must be set
What am I missing?
Hi brocaar
I meet the same err Error rpc error: code = Unavailable desc = grpc: the connection is unavailable (code: 2)
but it is different from ElizaBth
the loraserver and the lora-app-server are runing normal ,by checking the database ,I can get the data from node ,but when I enter the page of Organizations/LoRa Server/Applications/appname/nodename/Raw frame logs
some error occurred,it remain me Error transport is closing (code: 14) Error rpc error: code = Unavailable desc = grpc: the connection is unavailable (code: 2)
and the log is as below
That looks like a bug. Please create an issue here and I’ll look into it: https://github.com/brocaar/loraserver Please also provide the version of LoRa Server that you’re using in the issue.