Msg="ping database error, will retry in 2s: dial tcp: lookup loraserver on 127.0.1.1:53: no such host"

I have changed dsn in the /etc/loraserver/loraserver.toml file,like this :

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

and I have also chnged dsn in the /etc/lora-app-server/lora-app-server.toml file ,like this:

dsn=“postgres://appserver:#@localhost/loraserver_as?sslmode=disable”

But when I use

sudo journalctl -f -n 100 -u loraserver.service

or

sudo journalctl -f -n 100 -u lora-app-server

I have this error message:

level=error msg=“ping database error, will retry in 2s: dial tcp: lookup loraserver on 127.0.1.1:53: no such host”

or

time=“2018-06-01T08:02:51+04:30” level=error msg=“ping database error, will retry in 2s: dial tcp: lookup appserver on 127.0.1.1:53: no such host”

How can I fix this error?
please help me.tnx

Isn’t anybody help me ?

This is a community based support platform, you can not expect people to respond within hours after posting your question. Be a bit more patient please :slight_smile:

To answer your question, please note that the # character is also used for comments. You might need to escape it so that it is not interpreted, e.g. \#. Thus:

dsn=“postgres://loraserver:\#@localhost/loraserver_ns?sslmode=disable”

Note, I haven’t tried it myself.

I have tested it with \# but the loraserver or lora app server can’t be active in this case.
Actually I can run web ui in wmware but in main system I have above error.
Tanks, for quick answer.

check

  • firewall
  • mandatory access control (selinux, apparmor, etc),
  • port mappings if you threw it into the container.

a desciption of the bigger picture of your deployment including relevant config files will help pinning the cause of the problem.

l use dsn=“postgres://loraserver_ns:dbpassword@localhost/loraserver_ns?sslmode=disable" in etc/loraserver/loraserver.toml.
dsn=“postgres://loraserver_as:dbpassword@localhost/loraserver_as?sslmode=disable" and jw_secure=“dbpassword” in /etc/lora-app-server/lora-app-server.toml and then restart both of them and then it work.
tnx.