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

Hi!

After doing all the changes in config files, my error is:

Nov 07 17:22:18 CMTJM42 systemd[1]: loraserver.service: Scheduled restart job, restart counter is at 4.
Nov 07 17:22:18 CMTJM42 systemd[1]: Stopped LoRa Server.
Nov 07 17:22:18 CMTJM42 systemd[1]: Started LoRa Server.
Nov 07 17:22:18 CMTJM42 loraserver[1603]: time="2018-11-07T17:22:18Z" level=fatal msg="read configuration file error" error="While parsing config: (38, 14): keys cannot contain : character"

This error brings me to the DSN line on every config, but I don’t understand why it displays this error, because I haven’t any " : " character on my password…

In loraserver.toml the config is:

POSTGRES_DSN=postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable

And in lora-app-server.toml the config is:

POSTGRES_DSN=postgres://loraserver_as:dbpassword@localhost/loraserver_as?sslmode=disable

It may be catching “ns:dbpassword” and “as:dbpassword” as the complete passwords?
I haven’t /etc/default/loraserver file neither folder… is anything wrong in my configuration?

Thanks in advance

Please see the configuration example, the above configuration line does not match the expected syntax: https://www.loraserver.io/loraserver/install/config/.

Hi All,
I am also facing the same problem and tried all the suggested solutions. Still, I am facing the same issues. Moreover, I could not access the UI interface by host address. Here I have attached required images. If anyone can help me to fix those issue, it will be really helpful for me.

Thanks it helped me in solving authentication problem

Now I got the new one that stated as

Thanks in advance

Try starting loraserver manually (sudo loraserver --config /path/to/your/conf_file.toml) to see the error directly on the output, or check the logs (sudo journalctl -u loraserver -f -n 50).

It gives error
FATA[0000] error loading config file config=/path/to/your/conf_file.toml error=“open /path/to/your/conf_file.toml: no such file or directory”

Well, of course, that’s a fake path, you need to change it for yours.

Oh that was my mistake

Now It gives that error

**INFO[0000] starting LoRa App Server docs=“https://www.loraserver.io/” version=2.5.1
INFO[0000] connecting to postgresql
ERRO[0000] ping database error, will retry in 2s: pq: password authentication failed for user “root”
ERRO[0002] ping database error, will retry in 2s: pq: password authentication failed for user “root”
ERRO[0004] ping database error, will retry in 2s: pq: password authentication failed for user “root”
**

¿Did you read https://www.loraserver.io/loraserver/install/config/? Because it seems you didn’t configure Postgre’s DSN. In short, loraserver is trying to connect as the running user, in this case root because it was ran with sudo, and that’s because the DSN doesn’t mention any user (which you should have already configured when creating the databases). So you should change this:

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

To this:

dsn="postgres://user:password@hostname/database_name?sslmode=disable"

It’s either that or you are starting loraserver without passing a conf file so it uses defaults.

Thanks for your reply it is helping me solving the issue

Configuration of dns is ok now
it gives that error now

The user that’s connecting to the database (the one mentioned in the DSN) doesn’t have permissions to read or write to the gorp_migrations table. Please read the docs again and redo the Postgres steps (drop the databases and users that you created for loraserver and lora-app-server before redoing them, check Postgres’ docs if you are not familiar with the syntax), your users and databases are not correctly set.

Thanks I will surely go through it

Abdul,

Would you like to give me the link of documentation that guides me about grop_migration
It will be very helpful for me

There’s nothing special about that table, I mean the general docs on how to install everything. For example, here’s the docs for loraserver: https://www.loraserver.io/loraserver/install/debian/. As you may see, commands for creating the user and database are mentioned there. Other components have similar install instructions that you need to follow.

1 Like

this is the loraserver documentation to get started: i recommend reading everything
https://www.loraserver.io/guides/debian-ubuntu/

here is the postgres part:
https://www.loraserver.io/guides/debian-ubuntu/#setup-postgresql-databases-and-users

and if you want to learn more about postgres i recommend this tutorial:
http://www.postgresqltutorial.com/

2 Likes

I had this problem in a different place, but my mistake was that I wrote “dns=” instead of “dsn=”. I dont know if that will help in any way.

1 Like

your problem was a different one - if your dsn is wrong you can’t connect.
Wajid_Maqsood has problems inside the database. he didnt set the database up in a correct way (permissions are wrong).

2 Likes

I have gone through your instructions and it help me really well
I manually config the loraserver but there is an error that got me stuck
would you like to help me in it the picture of the error is attached below

Regards,

you still have postgres problems… what version of postgres do you have installed? did you really creat two databases (one for loraserver and one for lora-app-server)?

1 Like

yes i have created different databases for lora server and lora-app-server