{"record":{"id":"f98f7b9fb9ff55d5","repo":"kubernetes/kops","slug":"error-building-dns-client-w","errorCode":null,"errorMessage":"error building dns client: %w","messagePattern":"error building dns client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/cloud.go","lineNumber":422,"sourceCode":"\t// 2.47 is the minimum version where the compute API /server/details returns flavor names\n\tnovaClient.Microversion = \"2.47\"\n\n\tglanceClient, err := openstack.NewImageV2(provider, gophercloud.EndpointOpts{\n\t\tType:   \"image\",\n\t\tRegion: region,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building glance client: %w\", err)\n\t}\n\n\tvar dnsClient *gophercloud.ServiceClient\n\tif hasDNS {\n\t\tdnsClient, err = openstack.NewDNSV2(provider, gophercloud.EndpointOpts{\n\t\t\tType:   \"dns\",\n\t\t\tRegion: region,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error building dns client: %w\", err)\n\t\t}\n\t}\n\n\tc := &openstackCloud{\n\t\tcinderClient:  cinderClient,\n\t\tneutronClient: neutronClient,\n\t\tnovaClient:    novaClient,\n\t\tdnsClient:     dnsClient,\n\t\tglanceClient:  glanceClient,\n\t\ttags:          tags,\n\t\tregion:        region,\n\t\tuseOctavia:    false,\n\t}\n\n\tsetFloatingIPSupport(c, spec)\n\terr = buildLoadBalancerClient(c, spec, provider, region)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to build load balancer client: %w\", err)","sourceCodeStart":404,"sourceCodeEnd":440,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/cloud.go#L404-L440","documentation":"This error wraps a failure from gophercloud's openstack.NewDNSV2 when kOps tries to build a Designate DNS v2 service client during OpenstackCloud construction. It occurs only when the cluster spec enables DNS (hasDNS) but the Designate endpoint cannot be resolved or the client cannot be authenticated/created for the given region.","triggerScenarios":"openstack.NewDNSV2(provider, EndpointOpts{Type:\"dns\", Region:region}) returns an error: no 'dns' service endpoint (Designate) in the catalog for the region, endpoint discovery failure, or auth/token issues against the identity service.","commonSituations":"OpenStack cloud without Designate installed; wrong region name in the kops cluster spec; OS_* environment variables pointing to a project lacking access to the dns service; Keystone catalog missing the 'dns' service type.","solutions":["Verify Designate (DNS service) is deployed and registered in the Keystone catalog for the target region (openstack service list | grep dns)","Check the region name in the cluster spec / OS_REGION_NAME matches an endpoint for the dns service","Re-run openstack auth (source rc file / fix OS_USERNAME, OS_PASSWORD, OS_PROJECT_NAME, OS_AUTH_URL) and confirm 'openstack zone list' works","If Designate is not used, disable the DNS requirement in the cluster spec so hasDNS is false"],"exampleFix":"// before: cluster spec pointing at wrong region\nregion: \"RegionTwo\" // no dns endpoint exists here\n// after\nregion: \"RegionOne\" // region hosting the Designate endpoint","handlingStrategy":"validation","validationCode":"// before building the cloud, verify the dns (designate) endpoint exists\nout, err := exec.Command(\"openstack\", \"endpoint\", \"list\", \"--service\", \"dns\", \"--region\", region).Output()\nif err != nil || len(out) == 0 { return fmt.Errorf(\"no designate endpoint in region %s\", region) }","typeGuard":null,"tryCatchPattern":"// go: inspect wrapped error\ndnsClient, err := NewOpenstackCloud(...)\nif err != nil && strings.Contains(err.Error(), \"error building dns client\") {\n    // fail fast with guidance about Designate availability\n}","preventionTips":["Pin the region to one that hosts Designate","Smoke-test 'openstack zone list' in CI before kops runs","Keep OS_* credentials fresh via clouds.yaml"],"tags":["openstack","dns","gophercloud","designate"],"backgroundTag":"openstack-service-endpoint-not-found","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}