Error, will retry in 2s: pq: password authentication failed for user “loraserver”"

what about the version of postgres? try to answer all the questions

On upgrading Postgresql I am having that issue

In my loraserver.toml this is written:


When running following command , I’m asked to write password for user ‘loraserver_ns’

psql -U loraserver_ns -d loraserver_ns

Above command works. But still I receive this message:

maj 06 17:04:30 diplom-e18 loraserver[1949]: time="2019-05-06T17:04:30+02:00" level=warning msg="storage: ping PostgreSQL database error, will retry in 2s" error="pq: password authentication failed for user \"loraserver\""`

Can’t understand why it says "… failed for user “loraserver”, when in my toml it’s loraserver_ns

Your toml conf file is probably not getting picked up by loraserver because it’s either on an incorrect location or you’re passing another path to loraserver on start. You can check it works by running it manually with your toml path as seen in the docs:

loraserver --config /path/to/your/conf.toml

Thanks for the reply. When running: “sudo loraserver --config /etc/loraserver/loraserver.toml”

I receive this message:

FATA[0000] error loading config file  config=/etc/loraserver/loraserver.toml error="While parsing config: (1, 1): unexpected token"

What does this mean?

I’d need to see your file to check what’s exactly wrong, but the message is pretty clear: there’s an incorrect token on the first line, first column of your file, i.e., there’s some symbol at the start of the file that shouldn’t be there.

Thanks, @iegomez . As you said there was a wrong symbol on first line…

When running this command:

sudo journalctl -u loraserver -f -n 50

I still receive the same error:

But now this command works:

sudo loraserver --config /etc/loraserver/loraserver.toml



Changed dsn to:


Path to loraserver.toml:



psql -h localhost -d loraserver_ns -U loraserver_ns

Works, and asking for password. Password: “dbpassword”. Also works and I’m logged in.

Changed pg_hba.conf:

postgres auth was set as peer, but was changed to md5

Please avoid going off topic, this topic is about the PostgreSQL password authentication error.

1 Like

@iegomez I’ve done everything in this thread, but still doesn’t work… Maybe you can help?

Just noticed this:

loraserver toml is in following paths:

  • /etc/loraserver/loraserver.toml
  • $HOME/.config/loraserver/loraserver.toml

Copied from /etc/loraserver/loraserver.toml to $HOME/.config/loraserver/loraserver.toml

As Orne said, this if off topic and it’s probably already covered in the forum:

The postgresql installation default has the listener commented out in postgresql.conf.
Uncomment the listener to enable localhost.