Network server and application server cannot see configuration files on Ubuntu

Hi everyone,
I have a problem during the configuration of the network and application server.

I recently installed all the Chirpstack components on my Raspberry Pi 4. I had a small problem fixed thanks to your support on this forum and everything works now.

Yesterday I tried to help a friend installing Chirpstack on his Ubuntu machine, following exactly all the steps that I took during my installation, but we encountered some difficulties. In particular:

  • we placed the configuration file in the .config/chirpstack-network-server/ and .config/chirpstack-application-server/ directories since on my Raspberry I found that it encountered difficulties in accessing the file inside the /etc/ folder;
  • we named the PostgreSQL databases like on the installation guide, using the exact same password;
  • I gave him exactly my config files, copy-pasting them in the .config respective directories

Nonetheless, once the service is started we find the following message in the log (example from the network server log):

chirpstack-network-server[17109]: time="2020-04-10T09:49:09+02:00" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="pq: password authentication failed for user \"networkserver\""

We have never defined a networkserver user, and the dsn in our configuration file is defined as

dsn="postgres://chirpstack_ns:dbpassword@localhost/chirpstack_ns?sslmode=disable"

This is suggesting me that, when the service is started using sudo systemctl start chirpstack-network-server it cannot find the configuration file and it starts with a default value.

We also tried to give all the permissions to all the configuration files using sudo chmod 777 chirpstack-network-server.toml but the warning is still there.

Finally, we also tried stopping the service and starting it with chirpstack-network-server --config .config/chirpstack-network-server/chirpstack-network-server.toml and everything worked with no warning messages, so the file was read at start.

Had you got a similar problem and do you know how to solve it?
Thank you in advance for your help,
Damiano

The correct locations are /etc/chirpstack-network-server/chirpstack-network-server.toml and /etc/chirpstack-application-server/chirpstack-application-server.toml. The $HOME/.config/chirpstack-network- ... works, on the $HOME variable of the user under which the server is started.