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

As the error states, you are not setting the --gw-server-jwt-secret flag (or GW_SERVER_JWT_SECRET env), which must be set.

Right, I corrected this in bot server and app-server.
No mention of it in https://docs.loraserver.io/install/quick-install/
Now both servers are running.

Now when access in the app-gateway I get this:

afbeelding
I had to move the port as it is occupied already.

When i use https I get a real website :slight_smile:

Thanks for thinking along with me.

1 Like

I seem to be having the same issue (or one resembling it). Just spun up a new instance using the quick-install method, as I wanted to test whether or not we’re getting a response on OTAA requests back to the gateways. Right now we’re not on the first install. In any case, I’ve checked /etc/default/loraserver and it says this:

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

That seems to match reality. I used psql and the users and roles seem fine. the error changes like one would expect if I change the DSN string for Postgres in the loraserver config, so I’m a tad baffled.

Actual Error message:

Dec 07 16:21:26 mint-1802 loraserver[1299]: time=“2017-12-07T16:21:26-06:00” level=error msg=“ping database error, will retry in 2s: pq: password authentication failed for user “loraserver_ns””

Ancillary info:

Brand new apt-get install on all the software
Postgres 9.5.10

Thanks!

tl;dr Never Mind

OK, I discovered that I had to make modifications to the way that Postgres deals with logins. This may not be the REAL AND PROPER way to do it, but I know little of Postgres (MySql, Mongo, and MSsql mostly), and have to get this up and running. In any case, I googled and found this. Eventually I ended up with my /etc/postgresql/9.5/main/pg_hba.conf looking like this:

# "local" is for Unix domain socket connections only
local   all             all                                     trust

Since this is just to ensure that things work, I can figure out how to clean up my actual install, when I get to that point.

I intent to create a new post, which will also mention this problem.

After many efforts and with support of @brocaar and other users i have this-last-problem.

I have the same problem with loraserver, despite i tried whatever your suggested solutions in postgresql.conf file i still have the same authentication problem, while i debug loraserver from /etc:

.

Executing service command seems everything ok:

.

As a result,while pkt fwd and lora-gateway-bridge seem to communicate each other

, i can’t see this gateway (activity) in loraserver client

It has really to do with authentication problem finally?

Thanks in advance,
Nikos.

PS:i can also share my loraserver.toml configuration file.

The first problem solved as i found a reference in another post an execute below command(s):
loraserver --config /etc/loraserver/loraserver.toml
lora-app-server --config /etc/lora-app-server/lora-app-server.toml

Everything seems to run ok, except two fatal errors:

As a result, i can’t establish communication between loraserver and lora-gateway-bridge (which communicates with packet forwarder).

Any idea/advice about possible reasons of this error?

1 Like

From your errors, ports 8000 and 8001 are in use, probably because you didn’t stop the services before running them manually.

Thanks for the reply @iegomez.
I will try tomorrow morning stop services first and run manually them, as you mentioned. If you know, is it better to run services automatically or manually using “loraserver --config /etc/loraserver/loraserver.toml”?

PS: This is the reason of not showing in loraserver (client) the data (which send between lora-gateway-bridge and IC880a-spi, the concentrator)

Usually when deploying to production you want your programs to run as a service, but if you are developing over Orne’s code you are fine running it manually to debug different configurations, try new implementations, etc. Just be sure you have the correct conf files and permissions when you run things as a service.

Hello everybody!
I followed the instruction to install lora server and lora app server under Ubuntu16.04,and i have two problems and i am very confused.
first,the instuction on the lora server says:
“How you need to (re)start and stop LoRa Server depends on if your distribution uses init.d or systemd.
init.d
sudo /etc/init.d/loraserver [start|stop|restart|status]
systemd
sudo systemctl [start|stop|restart|status] loraserver
Now you’ve setup LoRa Server, it is a good time to verify that LoRa Server is actually up-and-running. This can be done by looking at the LoRa Server log output.
Like the previous step, which command you need to use for viewing the log output depends on if your distribution uses init.d or systemd.
init.d
All logs are written to /var/log/loraserver/loraserver.log. To view and follow this logfile:
tail -f /var/log/loraserver/loraserver.log
systemd
journalctl -u loraserver -f -n 50”

I think it means i can use the lora server log to confirm if my lora server is working well.there is no directory in the /var/log/loraserver/loraserver.log,so i think my distribution uses system to start.
when i use
“sudo systemctl start loraserver
journalctl -u loraserver -f -n 50” it gets a error.


and then i find a command in a post.
loraserver --config /etc/loraserver/loraserver.toml
lora-app-server --config /etc/lora-app-server/lora-app-server.toml.
lora%20server
when i use this command ,it is ok?does it mean my lora server is well done ?but why i use "journalctl -u loraserver -f -n 50"it makes error?i think it does not load the configration file in the /etc/loraserver/loraserver.toml,do i right?what i need to do?:grinning:

Thank you very much for your reply.

Did you change the postgresql.dsn value ?

For loraserver in /etc/loraserver/loraserver.toml.

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

For lora-app-server in /etc/lora-app-server/lora-app-server.toml.

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

thanks your reply.you are very careful:blush:
yes, i have changed my value.
in /etc/loraserver/loraserver.toml.,


and in /etc/lora-app-server/lora-app-server.toml

i think it is right.
i don’t know how to do .
thanks a lot

Have you tried to restart loraserver (so that it can load the updated configuration)?

Edit: I have moved your post as this question has already been asked. The solution might already be in this thread :slight_smile:

thank you brocaar,you are very kind.
when i restart,something different happens.
i use "journalctl -u loraserver -f -n 50 "and “ loraserver --config /etc/loraserver/loraserver.toml
”for lora server.


"journalctl -u lora-app-server -f -n 50"and “lora-app-server --config /etc/lora-app-server/lora-app-server.toml”for lora-app-server

from the before replies in this topic,i think my problem is ports 8000 and 8080 are in use,the friend said "probably because you didn’t stop the services before them manully ."but i have already restart loraserver and lora-app-server.what should i do next?thank you very much for your reply.

hello,i have the same problem with you,can you tell me how to deal with error:bind address already in use? i have tried several solutions but don’t work.

Not here please :slight_smile: https://forum.loraserver.io/search?q=address%20already%20in%20use

brocaar,thank you for your help with me ! I am so stupid:sob:

Hi guys, please help me on this. I have exactly followed the instructions of quick install given on https://www.loraserver.io/install/quick-install/. But when I try to reboot the lora server and try to see the logs then it gives me this error. I tried all sorts of online resources but couldn’t resolve it. could anyone help me on where i’m going wrong.

I have created loraserver_ns and loraserver_as as databases for the lora server.I have set two different passwords for lora_ns and lora_as.

– set up the users and the passwords
– (note that it is important to use single quotes and a semicolon at the end!)
create role loraserver_as with login password ‘ABC’;
create role loraserver_ns with login password ‘XYZ’;

– create the database for the servers
create database loraserver_as with owner loraserver_as;
create database loraserver_ns with owner loraserver_ns;

– change to the LoRa App Server database
\c loraserver_as

– enable the pq_trgm extension
– (this is needed to facilidate the search feature)
create extension pg_trgm;

– exit psql
\q

MY DSN CONFIG IN POSTGRES is as follows:
dsn=“postgres:loraserver_ns:XYZ@localhost/loraserver_ns?sslmode=disable”

The DB user trying to connect is wrong (it says loraserver instead of loraserver_ns), which is probably due to a wrong dsn. At your loraserver.toml you should have something like this (following your given steps):

[postgresql]
dsn="postgres://loraserver_ns:XYZ@localhost/loraserver_ns?sslmode=disable"

The same advice goes for lora-app-server if you have a similar problem.

Thanks for quick response. As i have posted in my question the dsn is already configured as you said . Still it says loraserver instead of loraserver_ns.

I have configure it as follows.