{"record":{"id":"3e5a32a14aa3cc0d","repo":"kubernetes/kops","slug":"got-error-while-querying-kubernetes-api-w","errorCode":null,"errorMessage":"got error while querying kubernetes api: %w","messagePattern":"got error while querying kubernetes api: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/verifier.go","lineNumber":166,"sourceCode":"\t// ensure that request is coming from same machine\n\trequestAddr, _, err := net.SplitHostPort(rawRequest.RemoteAddr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid remote address %q: %v\", rawRequest.RemoteAddr, err)\n\t}\n\tif !stringInSlice(requestAddr, addrs) {\n\t\treturn nil, fmt.Errorf(\"authentication request address %q does not match server addresses %v\", requestAddr, addrs)\n\t}\n\n\t// We will call back onto this address, now that we have verified it is an instance IP\n\tchallengeEndpoint := net.JoinHostPort(requestAddr, strconv.Itoa(wellknownports.NodeupChallenge))\n\n\t// check from kubernetes API does the instance already exist\n\t_, err = o.kubeClient.CoreV1().Nodes().Get(ctx, instance.Name, v1.GetOptions{})\n\tif err == nil {\n\t\treturn nil, bootstrap.ErrAlreadyExists\n\t}\n\tif err != nil && !errors.IsNotFound(err) {\n\t\treturn nil, fmt.Errorf(\"got error while querying kubernetes api: %w\", err)\n\t}\n\n\tresult := &bootstrap.VerifyResult{\n\t\tNodeName:          instance.Name,\n\t\tCertificateNames:  addrs,\n\t\tChallengeEndpoint: challengeEndpoint,\n\t}\n\tvalue, ok := instance.Metadata[TagKopsInstanceGroup]\n\tif ok {\n\t\tresult.InstanceGroupName = value\n\t}\n\treturn result, nil\n}\n","sourceCodeStart":148,"sourceCodeEnd":180,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/verifier.go#L148-L180","documentation":"After verifying the request comes from the instance, the challenge callback to the Kubernetes API (checking the node's challenge endpoint) failed. This is a Kubernetes API connectivity or authorization failure during node bootstrap verification, not an OpenStack failure.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstack/verifier.go:166 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check kops-controller's ability to reach the Kubernetes API server","Verify RBAC credentials used by the verifier","Retry; API server unavailability during bootstrap is often transient"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}