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


#67

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


#68

On upgrading Postgresql I am having that issue


#69

In my loraserver.toml this is written:

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

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


#70

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

#71

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?


#72

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.


#73

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

Response:

WHAT I’VE ALREADY DONE:

Changed dsn to:

dsn=“postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable”


Path to loraserver.toml:

/etc/loraserver/loraserver.toml


psql:

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


#75

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


#76

@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


#77

As Orne said, this if off topic and it’s probably already covered in the forum: https://forum.loraserver.io/search?q=no%20configuration%20file%20found