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


#26

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?


Compatible Repositories for Lora Gateways and LoraNodes combined/compatible with LoraServer and LoraAppServer
#27

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


#28

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)


#29

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.


#30

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.
lora%20server%20log%20put%20out
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.


#31

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


#32

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


#33

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:


#34

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.


#35

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.


#36

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


#37

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


#38

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”

capture


#39

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.


#40

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.


#41

Then check the location of your toml file is correct. Also, if you modify it, you need to restart the service for it to pick up any changes.


#42

I have restarted it many times but still got the same error. That means i might be wrong with the location of toml file.
Could you please expand on what exactly you mean by the location of toml file?. Thanks a lot.


#43

You may see where the conf file may be located (or how to define a location) here: https://www.loraserver.io/loraserver/install/config/. The other modules (app server and gateway bridge) have analogous docs.


#44

my message is:
level=error msg=“ping database error, will retry in 2s: dial tcp [::1]:5432: connect: connection refused”

what’s wrong?


#45

Maybe an answer here:

https://forum.loraserver.io/t/error-msg-ping-database-error-will-retry-in-2/134