Error dial tcp: lookup xxxxx.: no such host

1,217 views
Skip to first unread message

Carlos Alberto Sanchez Perez

unread,
Feb 19, 2022, 10:30:57 AM2/19/22
to KrakenD Community
Hello everyone, excellent that this group exists, we should make a group on Discord, :D, I am using KrakenD for the first time and I think it's great, I am developing an API in spring-boot, and I am using consul, so I thought it was a great idea to use KrakenD as my API gateway because it is so easy to implement. So far I followed Piotr Minkowski's guide, with the difference that I don't use Micronaut, here is an image of my architecture:
arquitecture.png
I made a simple krakend.json file (attached) just to test a service, but when doing the first un get the result is the following:
error-kraken.png
The only thing that causes me doubt maybe is the DNS configuration I made, I deployed a consul with DNS included and configure on my server with the following link: Forward DNS for Consul Service Discovery

I appreciate any help or guidance you can give me, regards.

Carlos Sanchez.  





1645217935049-krakend.json

Carlos Alberto Sanchez Perez

unread,
Feb 19, 2022, 10:35:58 AM2/19/22
to KrakenD Community, Carlos Alberto Sanchez Perez
I attach the image of the error again the previous one does not look very good, thanks again.error-kraken2.png 

Carlos Alberto Sanchez Perez

unread,
Feb 21, 2022, 6:41:52 AM2/21/22
to KrakenD Community, Carlos Alberto Sanchez Perez
Hello everyone, I hope you have a good start of the week.

Doing a more thorough review, I could detect that my error was that my services running on docker containers were detecting the address of the same docker container id, so adding the following line in my properties file (spring.cloud.consul.discovery.preferIpAddress= true) I could solve the error that showed Krakend, but I came up with 3 new details which I expose below:

1. I deployed krakend in a container to not have it installed directly as a service on my test server, but it was not detecting the dns of my services in consul.

2. Connect the krakend container to the network of my consul container, and it can see the services, but the only way to get krakend working was to make requests directly to the krakend container, if I try to make requests from another machine to the server or from an external network, I get the message, that the connection is blocked to the krakend port. Check ports and firewall and everything is ok.

3. With krakend installed directly as a service on my fedora 35 server, I can load the krakend.json file without problems and I can make requests from other machines even from outside my network and krakend works, only when making wrong requests my backend for example answers 400 not found and krakend returns 500 internal server error, is there any way for krakend to return the error that my backend answers.

Thank you very much to all, I am very excited to learn and use krakend in my implementations.

 

Kind regards.
Carlos Sánchez 
El sábado, 19 de febrero de 2022 a las 12:30:57 UTC-3, Carlos Alberto Sanchez Perez escribió:
Reply all
Reply to author
Forward
0 new messages