{"record":{"id":"76a2d9cf173623af","repo":"kubernetes/kops","slug":"error-fetching-kopscontrolplane-v-w","errorCode":null,"errorMessage":"error fetching KopsControlPlane %v: %w","messagePattern":"error fetching KopsControlPlane (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/controllers/clusterapi/utils.go","lineNumber":136,"sourceCode":"\t}\n\tkind, _, _ := unstructured.NestedString(capiCluster.Object, \"spec\", \"controlPlaneRef\", \"kind\")\n\tif kind == \"\" {\n\t\treturn nil, fmt.Errorf(\"controlPlaneRef.kind not set for %v\", capiClusterKey)\n\t}\n\tif kind != \"KopsControlPlane\" {\n\t\treturn nil, fmt.Errorf(\"controlPlaneRef.kind was %q for %v, expected KopsControlPlane\", kind, capiClusterKey)\n\t}\n\n\tkey := types.NamespacedName{\n\t\tNamespace: capiCluster.GetNamespace(),\n\t\tName:      name,\n\t}\n\n\t// TODO: Add ip addresses to status\n\n\tkopsControlPlane := &v1beta1.KopsControlPlane{}\n\tif err := kube.Get(ctx, key, kopsControlPlane); err != nil {\n\t\treturn nil, fmt.Errorf(\"error fetching KopsControlPlane %v: %w\", key, err)\n\t}\n\n\treturn kopsControlPlane, nil\n}\n","sourceCodeStart":118,"sourceCodeEnd":141,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/controllers/clusterapi/utils.go#L118-L141","documentation":"Fetching the KopsControlPlane resource named by the CAPI cluster's controlPlaneRef from the API server failed; a Kubernetes API error (not-found, RBAC, connectivity) rather than a malformed reference — the reference was already validated.","triggerScenarios":"Thrown at pkg/controllers/clusterapi/utils.go:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error: NotFound means the KopsControlPlane does not exist yet or the name is wrong","Verify the controller's RBAC allows reading KopsControlPlane objects","Confirm the API server is reachable"],"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-12T07:17:12.445Z"}