-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routing fails randomly, version 0.10.x #2290
Comments
The message explains exactly what happens. Kong queries the dns server to resolve the hostname but does not receive a proper answer from that server. As you can see here it will take the If they are not set, it will be 5 attempts and a timeout of 2 seconds. The When Kong resolves a name it will try to resolve in the following order 'last-successful-type', |
what do the DNS records look like, in that order? |
It is following: ; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7_2.4 <<>> mesos-ui.marathon.slave.mesos ;; QUESTION SECTION: ;; ANSWER SECTION: ;; Query time: 0 msec I noticed one thing with resolv.conf file though, the error comes when it has following nameservers: nameserver 10.254.20.255 In this case only the first 3 are relevant ones and when I tested routing with having only those in resolv.conf file (removed everything else from it) it is working fine (no errors)! |
interesting, I'd expect the resolver to pick the next nameserver on a retry, but maybe it doesn't and then fails while keep trying the same bad nameserver. What is the response you get if you explcitly query those removed servers? |
actually I don't think the That's probably why the bad nameserver was queried where it shouldn't have been. |
fixed it in Kong/lua-resty-dns-client#7 Kong dependency needs to be updated after releasing new dns client version |
Summary
I noticed that sometimes Kong routing to an API fails, this happens randomly. When trying to access an application through Kong the following error message comes to browser window “An unexpected error occurred". Earlier this was working fine with Kong version 0.9.7 and Cassandra 2.x.
[error] 126#0: *8877 [lua] responses.lua:101: before(): failed the initial dns/balancer resolve for 'xxx' with: dns query returned no results, client: xxx.xxx.xxx.xxx, server: kong, request: "GET /yyy HTTP/1.1", host: "xxx:8080"
The API creation command:
curl -X POST localhost:8001/apis/ -d 'name=xxx' -d 'upstream_url=http://xxx:8080' -d 'preserve_host=true' -d 'uris=/yyy' -d 'strip_uri=true'
Steps To Reproduce
Repeat GET request several times for an API.
Additional Details & Logs
Kong version 0.10.0 & 0.10.1
Cassandra 3.0.10
The text was updated successfully, but these errors were encountered: