{"record":{"id":"6476709e8564c14e","repo":"kubernetes/kops","slug":"error-listing-endpoints-v-647670","errorCode":null,"errorMessage":"Error listing endpoints: %v","messagePattern":"Error listing endpoints: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"discovery/pkg/discovery/server.go","lineNumber":133,"sourceCode":"\t\t\t{\n\t\t\t\tName:         \"discoveryendpoints\",\n\t\t\t\tSingularName: \"discoveryendpoint\",\n\t\t\t\tNamespaced:   true,\n\t\t\t\tKind:         \"DiscoveryEndpoint\",\n\t\t\t\tVerbs:        []string{\"get\", \"list\", \"create\", \"update\", \"patch\"},\n\t\t\t},\n\t\t},\n\t}\n\ts.writeJSON(w, http.StatusOK, resp)\n}\n\nfunc (s *Server) handleListDiscoveryEndpoints(w http.ResponseWriter, r *http.Request, _ *UserInfo) {\n\tuniverseID := r.PathValue(\"universe\")\n\tns := r.PathValue(\"namespace\") // Empty if not in path\n\n\tendpoints, err := s.Store.ListDiscoveryEndpoints(r.Context(), universeID)\n\tif err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"Error listing endpoints: %v\", err), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\tresp := api.DiscoveryEndpointList{\n\t\tTypeMeta: metav1.TypeMeta{Kind: \"DiscoveryEndpointList\", APIVersion: \"discovery.kops.k8s.io/v1alpha1\"},\n\t}\n\n\tfor _, ep := range endpoints {\n\t\tif ns == \"\" || ep.ObjectMeta.Namespace == ns {\n\t\t\tresp.Items = append(resp.Items, *ep)\n\t\t}\n\t}\n\n\ts.writeJSON(w, http.StatusOK, resp)\n}\n\nfunc (s *Server) handleCreateDiscoveryEndpoint(w http.ResponseWriter, r *http.Request, userInfo *UserInfo) {\n\tuniverseID := r.PathValue(\"universe\")","sourceCodeStart":115,"sourceCodeEnd":151,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/discovery/pkg/discovery/server.go#L115-L151","documentation":"handleListDiscoveryEndpoints lists DiscoveryEndpoints from the store for the universe (then filters by namespace if present). A store-level failure is surfaced as 500 'Error listing endpoints: <err>'. Client-side routing/certs are fine; the failure is in the persistence layer.","triggerScenarios":"GET /{universe}/apis/discovery.kops.k8s.io/v1alpha1/discoveryendpoints (with or without /namespaces/{namespace}) where Store.ListDiscoveryEndpoints errors: backend down, invalid universe record, permissions, or data error.","commonSituations":"Store database outage; wrong/unknown universe in URL; expired DB credentials; kubectl-style discovery requests during backend maintenance.","solutions":["Read the server log / response body for the underlying store error.","Verify the store backend is healthy and reachable.","Confirm the universe ID in the path exists in the store.","Retry after fixing backend; check store credentials/permissions."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"resp, err := client.Get(listURL)\nif err == nil && resp.StatusCode == http.StatusInternalServerError {\n    time.Sleep(backoff)\n    return retry()\n}","preventionTips":["Verify the universe exists before listing","Monitor store backend health","Check store credentials as part of deployment"],"tags":["http","storage","list","internal-server-error"],"backgroundTag":"backend-store-unavailable","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"}