You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am encountering an issue in Kong when managing targets for an upstream. On every deployment restart the following error message we receives in kong logs:
2025/01/28 09:14:39 [error] 1411#0: *1338 stream [lua] targets.lua:186: on_target_event(): could not stop DNS renewal for target removed from cdf8e897-f305-49bd-bfe2-d2649edcec63: target object does not contain name and port, context: ngx.timer
I have the following target data for the upstream cdf8e897-f305-49bd-bfe2-d2649edcec63, retrieved using http://<kong-admin-url>/upstreams/cdf8e897-f305-49bd-bfe2-d2649edcec63/targets:
Copied the function from the above link which is as follows:
localfunctionget_dns_renewal_key(target)
iftargetand (target.balancerortarget.upstream) thenlocalid= (target.balancerandtarget.balancer.upstream_id) or (target.upstreamandtarget.upstream.id)
iftarget.targetthenreturnid..":" ..target.targetelseiftarget.nameandtarget.portthenreturnid..":" ..target.name..":" ..target.portendendreturnnil, "target object does not contain name and port"end
The target object contains the necessary fields (upstream.id and target), so I expect the function to return the correct key (e.g., 1d51682d-50ec-4768-ae21-0ec6215a9e66:10.4.76.247:3000).
However, every time a target is created, I get the following error in the Kong logs:
2025/01/28 09:14:39 [error] 1411#0: *1338 stream [lua] targets.lua:186: on_target_event(): could not stop DNS renewal for target removed from cdf8e897-f305-49bd-bfe2-d2649edcec63: target object does not contain name and port, context: ngx.timer
Expected Behavior:
The get_dns_renewal_key() function should successfully return the DNS renewal key in the format id:ip:port for each target. The error log should not occur when a target is created.
Request:
Please help identify why this error occurs even when the necessary fields (target and upstream.id) are present in the target data.
Is there a potential issue with how Kong is handling the DNS renewal for targets in this case?
Additional Information:
I have checked that the target data is correctly formed with the target field as ip:port (e.g., 10.4.76.247:3000), but the error still persists.
The issue happens whenever new pods are created and old ones removed from targets
Description:
I am encountering an issue in Kong when managing targets for an upstream. On every deployment restart the following error message we receives in kong logs:
I have the following target data for the upstream
cdf8e897-f305-49bd-bfe2-d2649edcec63
, retrieved usinghttp://<kong-admin-url>/upstreams/cdf8e897-f305-49bd-bfe2-d2649edcec63/targets
:Issue:
This is the function https://github.com/Kong/kong/blob/master/kong/runloop/balancer/targets.lua#L109 that is preforming these checks and it is called by https://github.com/Kong/kong/blob/master/kong/runloop/balancer/targets.lua#L186
From the above output i got it should return a string in the format
id:ip:port
for each target (e.g.,1d51682d-50ec-4768-ae21-0ec6215a9e66:10.4.76.247:3000
).Copied the function from the above link which is as follows:
The target object contains the necessary fields (
upstream.id
andtarget
), so I expect the function to return the correct key (e.g.,1d51682d-50ec-4768-ae21-0ec6215a9e66:10.4.76.247:3000
).However, every time a target is created, I get the following error in the Kong logs:
Expected Behavior:
The
get_dns_renewal_key()
function should successfully return the DNS renewal key in the formatid:ip:port
for each target. The error log should not occur when a target is created.Request:
target
andupstream.id
) are present in the target data.Additional Information:
target
field asip:port
(e.g.,10.4.76.247:3000
), but the error still persists.Any help or guidance in resolving this issue would be greatly appreciated.
The text was updated successfully, but these errors were encountered: