Error msg: ping database error, will retry in 2

Hello All!!

Today I did my first installation of the Lora server and the Lora Application Server and the Lora Server Gateway. Apparently everything is running ok. But the web page does not load and in the log files I see this message.

ubuntu lora-app-server [13835]: time = “2017-09-14T22: 12: 01-03: 00” level = error msg = "ping database error, will retry in 2s: dial tcp: address tcp / lora: unknown port "

My installation is done on top of a proxmox virtual server running ubuntu server 16.04.

Follow the tutorials on the page and I have already seen and reviewed the settings and I can not understand why it is not working.

Could you please help me?

ubuntu lora-app-server [13835]: time = “2017-09-14T22: 12: 01-03: 00” level = error msg = "ping database error, will retry in 2s: dial tcp: address tcp / lora: unknown port "

Looks like the --postgres-dsn value is not set correctly. Please see https://docs.loraserver.io/lora-app-server/install/config/

Something important I noticed is that you cant, even accidentally, insert a ‘#’ to any of your postgreSQL password. If you do, in your config files, it will be recognized as an incorrect config file which has all settings commented after the ‘3’. I received this exact error because of it. I spent so much time debugging it and finally realised it. May be this wont solve your issue, but I am stating it in case.

I think you can, but you need to escape it :slight_smile: E.g. by putting \ in front of it (not tested).

1 Like

I did try it in my earlier attempt. But it didn’t work out for me. I didnt bother so much because I had plenty of other characters on the keyboard :slight_smile:

Hi, first of all thanks for the answers.
I have reviewed my password settings and I have a special character as #.

So I logged in to the loraserver settings and inserted the \ before # by getting ******* \ # **** and still has the same connection error to the database.

Honestly I would not want to have a password with no character # because at my view would be a step back in the security issue of the Lora server.

If someone has any light please provide the solution.

Thank you in advance for a great week.

You can have a very strong password without the ‘#’ sign. You can simply refrain from using the # sign. Just use other characters. There are plenty :slight_smile:

Hello everyone. I am new to lora server and I am trying to figure out how it works.After the successfull installation of loraserver and lora-app-server I am struggling to start both of them. It seems that they are not able to read the configuration file in /etc/defaults/ directory. I changed the settings as suggested in the https://docs.loraserver.io/loraserver/overview/ .

Please give some help.
Thanks in advance :slight_smile:

maybe the dausername doesnt match the passwd?

what do you mean by dausername?

the db username must match the password

Hello,

the behavior of my LoRa Server & LoRa App Server seems to be not ok according to the log file.
I’m little bit confuse because the status of Servers is active please could you tell me if something is wrong ?

Hereinafter status snapshot:

I have only change PostgreSQL dsn in each respective configuration file:
dsn=“postgres://loraserver_ns:heremyreal_ns_dbpassword@Debian03/loraserver?sslmode=disable”
dsn=“postgres://loraserver_as:heremyreal_as_dbpassword@Debian03/loraserver?sslmode=disable”

FYI I am retrieving the same kind of log with journalctl -u loraserver.

Thank you for your help

As you can see, it tries to (re)connect to the database, which raises the error connection refused.

Yes,
so I tried to connect to database manually with ==> psql -h localhost -U loraserver_ns -W loraserver_ns

It works, but by doing snapshot I saw maybe the issue psql (9.4.15) while it’s recommended to use 9.5 isn’t it ?

Just can I follow your instruction to upgrade psql:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

export DISTRIB_CODENAME=lsb_release -sc
sudo echo “deb http://apt.postgresql.org/pub/repos/apt/ ${DISTRIB_CODENAME}-pgdg main” | sudo tee /etc/apt/sources.list.d/pgdg.list
sudo apt-get update

sudo apt-get install postgresql-9.6

???

Thank you

That is not the same hostname as from your configuration:

dsn=“postgres://loraserver_ns:heremyreal_ns_dbpassword@Debian03/loraserver?sslmode=disable”

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

better like this :wink:

Hi,

i followed the quickstart for docker-compose but i keep getting error when staring the server.

Can somebody help me please.

So i added username to postgres dns string and now the message changed:

[postgresql]
dsn=“postgres://loraserver_ns:ivor_ns_dbpassword@localhost/loraserver_ns?sslmode=disable”