{"record":{"id":"f1d4e2d79f6186e2","repo":"kubernetes/kops","slug":"error-deleting-cluster-q-v","errorCode":null,"errorMessage":"error deleting cluster%q: %v","messagePattern":"error deleting cluster%q: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/client/simple/api/clientset.go","lineNumber":188,"sourceCode":"\t\t\terr = c.KopsClient.InstanceGroups(namespace).Delete(ctx, ig.Name, metav1.DeleteOptions{})\n\t\t\tif err != nil {\n\t\t\t\tif errors.IsNotFound(err) {\n\t\t\t\t\t// Unlikely...\n\t\t\t\t\tklog.Warningf(\"instance group was concurrently deleted\")\n\t\t\t\t} else {\n\t\t\t\t\treturn fmt.Errorf(\"error deleting instance group %q: %v\", ig.Name, err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\terr = c.KopsClient.Clusters(namespace).Delete(ctx, name, metav1.DeleteOptions{})\n\tif err != nil {\n\t\tif errors.IsNotFound(err) {\n\t\t\t// Unlikely...\n\t\t\tklog.Warningf(\"cluster %q was concurrently deleted\", name)\n\t\t} else {\n\t\t\treturn fmt.Errorf(\"error deleting cluster%q: %v\", name, err)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc restNamespaceForClusterName(clusterName string) string {\n\t// We are not allowed dots, so we map them to dashes\n\t// This can conflict, but this will simply be a limitation that we pass on to the user\n\t// i.e. it will not be possible to create a.b.example.com and a-b.example.com\n\tnamespace := strings.ReplaceAll(clusterName, \".\", \"-\")\n\treturn namespace\n}\n","sourceCodeStart":170,"sourceCodeEnd":202,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/client/simple/api/clientset.go#L170-L202","documentation":"The final delete of the Cluster object itself failed with a non-NotFound error after keysets and instance groups were cleaned up; the API server rejected or failed the delete call. (The message has a known formatting quirk: a missing space before %q.)","triggerScenarios":"Thrown at pkg/client/simple/api/clientset.go:188 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped API error (conflict, RBAC, timeout)","Retry the delete operation","Remove the cluster object manually via kubectl if it persists"],"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"}