then check it is running. sudo systemctl status loraserver
Please check to ensure in your loraserver.service file property: ExecStart=/opt/loraserver/loraserver
is pointing to the correct location of where you installed the loraserver
I have installed multiple times and the services work. Check the syslog to see if there are any errors in there that may help.
1- Running ‘systemctl enable loraserver’ and then ‘journalctl –f –n 50 –u loraserver’ shows the following output:
Jan 10 22:06:56 localhost.localdomain systemd[1]: Started LoRa Server.
Jan 10 22:06:56 localhost.localdomain loraserver[10710]: time=“2020-01-10T22:06:56-05:00” level=info msg=“starting LoRa Server” band=EU_863_870 docs=“https:/www.loraserver.io/” net_id=000000 version=3.0.0
Jan 10 22:06:56 localhost.localdomain loraserver[10710]: time=“2020-01-10T22:06:56-05:00” level=info msg=“storage: setting up storage module”
Jan 10 22:06:56 localhost.localdomain loraserver[10710]: time=“2020-01-10T22:06:56-05:00” level=info msg=“storage: setting up Redis connection pool”
Jan 10 22:06:56 localhost.localdomain loraserver[10710]: time=“2020-01-10T22:06:56-05:00” level=info msg=“storage: connecting to PostgreSQL” Jan 10 22:06:56 localhost.localdomain loraserver[10710]: time=“2020-01-10T22:06:56-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error="pq: role “root” does not exist"
Can’t seem to figure out how to get the PostgreSQL db to connect – the /etc/loraserver/loraserver.toml file contains (and ‘mypw’ is correct – I also previously set up the roles using ‘sudo –u postgres psql’ and then ‘create role loraserver_ns with login password ‘mypw’;’ & ‘create database loraserver_ns with owner loraserver_ns;):
dsn=“postgres://loraserver_ns:mypw@localhost/loraserver_ns?sslmode=disable”
automigrate=true
name=“EU_863_870”
timezone=“Local”
server=“tcp://127.0.0.1:1883”
2- For the lora-app-server:
systemctl start lora-app-server
systemctl status lora-app-server
â lora-app-server.service - LoRa App Server
Loaded: loaded (/usr/lib/systemd/system/lora-app-server.service; disabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Fri 2020-01-10 22:47:40 EST; 294ms ago
Docs: https://www.loraserver.io/
Process: 13280 ExecStart=/opt/lora-app-server/lora-app-server (code=exited, status=203/EXEC)
Main PID: 13280 (code=exited, status=203/EXEC)
Jan 10 22:47:40 localhost.localdomain systemd[1]: Unit lora-app-server.service entered failed state.
Jan 10 22:47:40 localhost.localdomain systemd[1]: lora-app-server.service failed.
Jan 10 22:47:40 localhost.localdomain systemd[1]: lora-app-server.service holdoff time over, scheduling restart.
Jan 10 22:47:40 localhost.localdomain systemd[1]: Stopped LoRa App Server.
Jan 10 22:47:40 localhost.localdomain systemd[1]: start request repeated too quickly for lora-app-server.service
Jan 10 22:47:40 localhost.localdomain systemd[1]: Failed to start LoRa App Server.
Jan 10 22:47:40 localhost.localdomain systemd[1]: Unit lora-app-server.service entered failed state.
Jan 10 22:47:40 localhost.localdomain systemd[1]: lora-app-server.service failed.
3- Nowhere in the instructions did I see it say to install ttn-gateway, but at the end, it says to run ‘systemctl status ttn-gateway’ to ‘ensure that all services are running’?
You are correct at the end of the instructions it should NOT have asked you to check the status of the ttn-gateway. I will remove this line.
Regarding the error you have highlighted " storage: ping PostgreSQL database error, will retry in 2s” error="pq: role “root” does not exist" this looks to be an error with your toml file.
Can you check the following:
sudo vi /etc/postgresql/9.3/main/pg_hba.conf #ensure the 127.0.0.1/32 host entry is as follows:
host all 127.0.0.1/32 trust
Restart postgresql if need changed
Try and login to postgresql using your credenticals: psql -h localhost -U loraserver_ns -W loraserver_ns #and also psql -h localhost -U loraserver_as -W loraserver_as #Ensure you are able to login with the password in the toml files.
Please note that loraserver has been updated to ChirpStack and the configuration files have changed names that the services pick up. Ensure once you perform the install the files are correct.
My pg_hba.conf is at: /var/lib/pgsql/9.6/data/pg_hba.conf (instead of /etc/postgresql/9.3/main/pg_hba.conf) – yes, running 9.6 it seems, instead of 9.3 – could that be one cause?
These are the host entries in that file:
TYPE DATABASE USER ADDRESS METHOD
local all all trust
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
Logging into postgresql with my credentials works:
[root@localhost ~]# psql -h localhost -U loraserver_ns -W loraserver_ns
Password for user loraserver_ns:
psql (9.6.16)
Type “help” for help.
loraserver_ns=>
[root@localhost ~]# psql -h localhost -U loraserver_as -W loraserver_as
Password for user loraserver_as:
psql (9.6.16)
Funny though, just tried entering an INCORRECT password to login and it seemed to work? (no error shown)
If you can check the toml files dsn entry and ensure it is correct, e.g. should look like dsn="postgres://loraserver_as:YourPassword@localhost/loraserver_as?sslmode=disable"
Let me know how you get on.
I will also be redoing the how to guide based on the latest ChirpStack rpms.
The toml files (/etc/lora-app-server/lora-app-server.toml && /etc/loraserver/loraserver.toml) both have dsn entries identical to the one you provided (with the correct password). It should be noted that my password has a hash ("#") in it - not sure if that might pose an issue?
Regardless of what I do, I continue to get the following error when I start the lora server:
[root@localhost ~]# systemctl status loraserver
â loraserver.service - LoRa Server
Loaded: loaded (/usr/lib/systemd/system/loraserver.service; enabled; vendor preset: disabled)
Active: active (running) since Fri 2020-01-10 22:24:29 EST; 4 days ago
Docs: https://www.loraserver.io/
Main PID: 11842 (loraserver)
Tasks: 12
Memory: 10.8M
CGroup: /system.slice/loraserver.service
ââ11842 /opt/loraserver/loraserver
Jan 15 13:12:30 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:30-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:32 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:32-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:34 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:34-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:36 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:36-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:38 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:38-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:40 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:40-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:42 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:42-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:44 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:44-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:46 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:46-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
Jan 15 13:12:48 localhost.localdomain loraserver[11842]: time=“2020-01-15T13:12:48-05:00” level=warning msg=“storage: ping PostgreSQL database error, will retry in 2s” error=“pq: role “root” does not exist”
I have re-generated the jwt_secret so many times, but same issue – it’s just not detecting it. Also tried to manually set the env variable for jwt_secret using the following, but same issue:
[root@localhost ~]# export jwt_secret=“U7Wt3woh12Ze7IdGKlJlRVi4oMG5UrFcnExPevKkNic=”
[root@localhost lora-app-server]# openssl rand -base64 32
cXVjfuoQzGq0MHvdRpWGRlvyS65ibf39cUcSTY382Ik=
That might be helpful when you have an error in your config (e.g. wrong name / section, …). It will generate a configfile with all the (detected) values from lora-app-server.toml.
Most likely because the config key was in the wrong place and therefore was not interpreted. I recommend to use the output of configfile as a new start and fill in the missing bits