Hi!
I am trying to run loraserver / loraappserver all inside one system. But I keep getting the following error on the LoraAppServer side, when I run both loraserver and loraappserver
ERRO[0030] gwmigrate: list gateways error (will retry): rpc error: code = Unknown desc = missing destination name organization_id in *[]gateway.Gateway
I saw the post in github but and I made sure each have its own database and I added the db-AUTOMIGRATE flag on both, here is the complete command line parameters i am running for both, am i missing anything here ? Thank you!
Hi Jay, from your error message it looks like that your loraserver_ns database was not setup correctly? The gateway table should not contain a column organization_id. Could it be that you initialized the LoRa App Server schema by accident?
Could you run this command and post the output (it will prompt for your database password)?
Thank you for your prompt reply! I just tried dropping the database and recreated it and the issue seems to go away.
Now I am faced with another which seem to be complaining abut authentication between app server and network server.
From the app serverside:
INFO[0000] starting LoRa App Server docs=“https://docs.loraserver.io/” version=0.11.0
INFO[0000] connecting to postgresql
INFO[0000] setup redis connection pool
INFO[0000] handler/mqtt: connecting to mqtt broker server=“tcp://localhost:1883”
INFO[0000] connecting to network-server api ca-cert= server=“127.0.0.1:8000” tls-cert= tls-key=
INFO[0000] applying database migrations
INFO[0000] handler/mqtt: connected to mqtt broker
INFO[0000] handler/mqtt: subscribling to tx topic topic=“application/+/node/+/tx”
INFO[0000] migrations applied count=0
INFO[0000] gwmigrate: migrating gateway data from LoRa Server
INFO[0000] starting application-server api bind=“localhost:8001” ca-cert= tls-cert= tls-key=
INFO[0000] starting client api server bind=“0.0.0.0:8080” tls-cert="/var/lib/pgsql/Certs/cert.pem" tls-key="/var/lib/pgsql/Certs/key.pem"
INFO[0000] registering rest api handler and documentation endpoint path="/api"
INFO[0004] transport: http2Server.HandleStreams received bogus greeting from client: “\x16\x03\x01\x00\x92\x01\x00\x00\x8e\x03\x03\xe2\x91͉\aScWΎ\xd5ٺ”
From the network_server side:
INFO[0026] Failed to dial 127.0.0.1:8001: connection error: desc = “transport: authentication handshake failed: tls: first record does not look like a TLS handshake”;
I generated the cert and key file using “openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 90 -nodes” and passed both files in the application server and network server parameters.
I noticed that there are multiple parameters one can use to specifiy the cert and key, am I using the right ones ?
Anything I am missing here ?
Please note that you can leave all tls certificates out, except the --http-tls-cert and --http-tls-key in LoRa App Server (used for the LoRa Server web-interface and HTTP API). Please try if that works
Thank you for replying on a Sunday! I removed the extra tls parameters i had inside the network server and now I don’t see the error any more:
Here is what i am seeing on the LoRa App server, it means i am connected right ?
[root@localhost Lora_AppServer]# ./cmd_loraapp
INFO[0000] starting LoRa App Server docs=“https://docs.loraserver.io/” version=0.11.0
INFO[0000] connecting to postgresql
INFO[0000] setup redis connection pool
INFO[0000] handler/mqtt: connecting to mqtt broker server=“tcp://localhost:1883”
INFO[0000] connecting to network-server api ca-cert= server=“127.0.0.1:8000” tls-cert= tls-key=
INFO[0000] handler/mqtt: connected to mqtt broker
INFO[0000] handler/mqtt: subscribling to tx topic topic=“application/+/node/+/tx”
INFO[0000] applying database migrations
INFO[0000] migrations applied count=0
INFO[0000] gwmigrate: migrating gateway data from LoRa Server
INFO[0000] starting application-server api bind=“localhost:8001” ca-cert= tls-cert= tls-key=
INFO[0000] starting client api server bind=“0.0.0.0:8080” tls-cert="/var/lib/pgsql/Certs/cert.pem" tls-key="/var/lib/pgsql/Certs/key.pem"
INFO[0000] registering rest api handler and documentation endpoint path="/api"
It is working now, I am able to see the frames sent by my LoRa endpoint on the MQTT server and the web UI now. Thank you for the kind support, it has been a pleasure implementing!