PostgresSQL errror after upgrading to version 3.3.0

I upgraded the lora app server on my RAK rPI gateway and the app server won’t start anymore. The log continuously shows:

Aug 26 10:43:11 rak-gateway lora-app-server[549]: time="2019-08-26T10:43:11-07:00" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="pq: password authentication failed for user \"appserver\""

Any ideas, what’s going on. I did opt for updating the configuration file for the app server (since I was just using the default config). Also showing the same error after restarting the gateway.

Thanks,
Amir.

I updated the dsn and the above error went away.
But now getting this error

Aug 26 11:05:44 rak-gateway lora-app-server[1752]: time="2019-08-26T11:05:44-07:00" level=info msg="api/as: starting application-server api" bind="0.0.0.0:8001" ca_cert= tls_cert= tls_key=
Aug 26 11:05:44 rak-gateway lora-app-server[1752]: time="2019-08-26T11:05:44-07:00" level=fatal msg="setup api error: setup external api error: jwt_secret must be set!"
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Main process exited, code=exited, status=1/FAILURE
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Unit entered failed state.
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Failed with result 'exit-code'.
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Service hold-off time over, scheduling restart.
Aug 26 11:05:44 rak-gateway systemd[1]: Stopped LoRa App Server.
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Start request repeated too quickly.
Aug 26 11:05:44 rak-gateway systemd[1]: Failed to start LoRa App Server.
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Unit entered failed state.
Aug 26 11:05:44 rak-gateway systemd[1]: lora-app-server.service: Failed with result 'exit-code'.

I was able to fix the issue. Had to create a jwt_secret instead of the empty default one and also it appears sudo systemctl restart lora-app-server doesn’t work for some reasons. I had to do stop, wait for a couple of seconds, then start.

Lesson learned: Next time I upgrade loraserver, I’ll make sure all my config files are saved to a safe place.

A quick note also. The documentation with regards to configuration files and the quick start guides appear to be outdated.

Contributions to improve the docs are welcome! All the content is on GitHub :slight_smile:

I have a jwt_secret set in /etc/lora-app-server/lora-app-server.toml, but still showing this error:

Jan 23 17:55:38 localhost.localdomain systemd[1]: Started LoRa App Server.
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“starting LoRa App Server” docs=“https://www.loraserver.io/” version=3.0.0
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“storage: setting up storage package”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“storage: setting up Redis pool”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“storage: connecting to PostgreSQL database”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“storage: applying PostgreSQL data migrations”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“storage: PostgreSQL data migrations applied” count=0
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“integration/mqtt: TLS config is empty”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“integration/mqtt: connecting to mqtt broker” server=“tcp://localhost:1883”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“integration/mqtt: connected to mqtt broker”
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“integration/mqtt: subscribing to tx topic” qos=0 topic=application/+/device/+/tx
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=info msg=“api/as: starting application-server api” bind=“0.0.0.0:8001” ca_cert= tls_cert= tls_key=
Jan 23 17:55:39 localhost.localdomain lora-app-server[22338]: time=“2020-01-23T17:55:39-05:00” level=fatal msg="setup api error: setup external api error: jwt_secret must be set!"
Jan 23 17:55:39 localhost.localdomain systemd[1]: lora-app-server.service: main process exited, code=exited, status=1/FAILURE
Jan 23 17:55:39 localhost.localdomain systemd[1]: Unit lora-app-server.service entered failed state.
Jan 23 17:55:39 localhost.localdomain systemd[1]: lora-app-server.service failed.
Jan 23 17:55:39 localhost.localdomain systemd[1]: lora-app-server.service holdoff time over, scheduling restart.
Jan 23 17:55:39 localhost.localdomain systemd[1]: Stopped LoRa App Server.
Jan 23 17:55:39 localhost.localdomain systemd[1]: start request repeated too quickly for lora-app-server.service
Jan 23 17:55:39 localhost.localdomain systemd[1]: Failed to start LoRa App Server.
Jan 23 17:55:39 localhost.localdomain systemd[1]: Unit lora-app-server.service entered failed state.
Jan 23 17:55:39 localhost.localdomain systemd[1]: lora-app-server.service failed.

Any idea why?