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.
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.