Closed
Description
While testing the new bootstrap generator (GoogleCloudPlatform/traffic-director-grpc-bootstrap#57) which adds the new xdstp style in client_default_listener_name_template
to the config, I found that the virtual hosts lookup was failing with the following error:
2024/02/21 22:39:04 WARNING: [core] [Channel #1] ccResolverWrapper: reporting error to cc: no matching virtual host found for "xdstp://traffic-director-global.xds.googleapis.com/envoy.config.listener.v3.Listener/439293274322/default/helloworld-gke:8000"
2024/02/21 22:39:04 INFO: [core] [Channel #1] Channel switches to new LB policy "pick_first"
2024/02/21 22:39:04 INFO: [core] [pick-first-lb 0xc0002ae4b0] Received error from the name resolver: no matching virtual host found for "xdstp://traffic-director-global.xds.googleapis.com/envoy.config.listener.v3.Listener/439293274322/default/helloworld-gke:8000"
2024/02/21 22:39:04 INFO: [core] [Channel #1] Channel Connectivity change to TRANSIENT_FAILURE
2024/02/21 22:39:04 could not greet: rpc error: code = Unavailable desc = name resolver error: no matching virtual host found for "xdstp://traffic-director-global.xds.googleapis.com/envoy.config.listener.v3.Listener/439293274322/default/helloworld-gke:8000"
even though, we are getting a valid RDS response
2024/02/21 22:39:04 INFO: [xds] [xds-resolver 0xc000242d80] Received update for RouteConfiguration resource "URL_MAP/439293274322_grpc-gke-url-map_0_helloworld-gke:8000": {
"VirtualHosts": [
{
"Domains": [
"helloworld-gke:8000"
],
"Routes": [
{
"Path": null,
"Prefix": "",
"Regex": null,
"CaseInsensitive": false,
"Headers": null,
"Fraction": null,
"HashPolicies": null,
"MaxStreamDuration": null,
"HTTPFilterConfigOverride": null,
"RetryConfig": {
"RetryOn": null,
"NumRetries": 0,
"RetryBackoff": {
"BaseInterval": 0,
"MaxInterval": 0
}
},
"ActionType": 1,
"WeightedClusters": {
"cloud-internal-istio:cloud_mp_439293274322_77023378241484717": {
"Weight": 1,
"HTTPFilterConfigOverride": null
}
},
"ClusterSpecifierPlugin": ""
}
],
"HTTPFilterConfigOverride": null,
"RetryConfig": null
}
],
"ClusterSpecifierPlugins": {},
"Raw": {
"type_url": "type.googleapis.com/envoy.config.route.v3.RouteConfiguration",
"value": "CjtVUkxfTUFQLzQzOTI5MzI3NDMyMl9ncnBjLWdrZS11cmwtbWFwXzBfaGVsbG93b3JsZC1na2U6ODAwMBK+ARITaGVsbG93b3JsZC1na2U6ODAwMBqmAQoCCgASWwo8Y2xvdWQtaW50ZXJuYWwtaXN0aW86Y2xvdWRfbXBfNDM5MjkzMjc0MzIyXzc3MDIzMzc4MjQxNDg0NzE3QgIIHkoXCg1nYXRld2F5LWVycm9yEgIIARoCCB5yQ1VSTF9NQVAvNDM5MjkzMjc0MzIyX2dycGMtZ2tlLXVybC1tYXBfMF9oZWxsb3dvcmxkLWdrZTo4MDAwLXJvdXRlLTA="
}
}
The issue is that while parsing RDS to lookup virtual host we are using the entire LDS resource name and not just the domain, which is the dial target provided by the user.
I found the same issue in gRPC-java. This works in the following cases: when the virtual hosts domain name is the same the LDS resource name.