Missing destination name organization_id in *[]gateway.Gateway

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!

./loraserver --net-id 000001 --band US_902_928 --band-dwell-time-400ms --redis-url redis://localhost:6379 --postgres-dsn postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable --gw-server-jwt-secret 0728201718000000 --as-tls-cert /var/lib/pgsql/Certs/cert.pem --as-tls-key /var/lib/pgsql/Certs/key.pem --db-automigrate --bind localhost:8000 --gw-mqtt-username loraserver --gw-mqtt-password password --gw-create-on-stats --gw-stats-aggregation-intervals “minute,hour,day”

./lora-app-server --postgres-dsn postgres://loraserver_role:password@localhost/loraserver_db?sslmode=disable --redis-url redis://localhost:6379 --jwt-secret 0728201718000000 --db-automigrate --http-tls-cert /var/lib/pgsql/Certs/cert.pem --http-tls-key /var/lib/pgsql/Certs/key.pem --mqtt-server tcp://localhost:1883 --mqtt-username loraappserver --mqtt-password password --bind localhost:8001 --http-bind 0.0.0.0:8080 --ns-server 127.0.0.1:8000 --log-level 4 --pw-hash-iterations 100000

-Jay

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)?

psql -h localhost -U loraserver_ns -W -c "select * from gorp_migrations;" loraserver_ns

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 ?

thank you again for all your help!

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 :slight_smile:

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"

-Jay

All looks good to me :+1:

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!

1 Like