-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
set_target with hostname fails #12201
Comments
I created an internal ticket (KAG-3500) to track this issue. |
@chobits , do we have any update about this issue? |
hi This error log was reported by BTW for your code,
you dont need to check return value like |
hi, it's a conflict between the doc and its internal impelmentation, currently dns balancer will not actively resolve your setting host. using (KAG-3500) to track it. Currently your resolved method, using dns_client to resolve it, is ok. |
This issue is marked as stale because it has been open for 14 days with no activity. |
Is there an existing issue for this?
Kong version (
$ kong version
)3.4.0
Current Behavior
According to the Kong API docs I should be able to call set_target to set the upstream target in my plugin. This does not appear to work unless an IP address is used.
I found this issue which appears to be the same but was recently closed without any specific resolution.
Expected Behavior
Calling set_target with a hostname should work.
Steps To Reproduce
This code fails:
It results in this error message:
2023/12/13 15:12:11 [error] 69#0: *150 [lua] init.lua:1214: balancer(): failed to set the current peer (address: example.com port: 443): no host allowed while connecting to upstream, client: 127.0.0.1, server: kong, request: "GET / HTTP/1.1", host: "myservice.com"
To verify that DNS resolution is working, I ran this code which works as expected:
I have also checked that DNS resolution works via a shell on the pod.
Anything else?
I am running Kong as a container locally in Docker (on MacOS).
The text was updated successfully, but these errors were encountered: