kubernetes/kops · error

Error getting endpoint: %v

Error message

Error getting endpoint: %v

What it means

GET of a single DiscoveryEndpoint failed because Store.GetDiscoveryEndpoint returned an error while reading from the backend. The server wraps it into HTTP 500 with 'Error getting endpoint: %v'. A missing endpoint is NOT this error — that returns 404 via http.NotFound when found == nil.

Source

Thrown at discovery/pkg/discovery/server.go:236

		log.Error(err, "error applying endpoint")
		http.Error(w, fmt.Sprintf("Error applying endpoint: %v", err), http.StatusInternalServerError)
		return
	}

	// Return the created object
	s.writeJSON(w, http.StatusCreated, input)

	log.Info("Applied endpoint", "namespace", input.ObjectMeta.Namespace, "name", input.ObjectMeta.Name, "universe", universeID)
}

func (s *Server) handleGetDiscoveryEndpoint(w http.ResponseWriter, r *http.Request, _ *UserInfo) {
	universeID := r.PathValue("universe")
	ns := r.PathValue("namespace")
	name := r.PathValue("name")

	found, err := s.Store.GetDiscoveryEndpoint(r.Context(), universeID, ns, name)
	if err != nil {
		http.Error(w, fmt.Sprintf("Error getting endpoint: %v", err), http.StatusInternalServerError)
		return
	}

	if found == nil {
		http.NotFound(w, r)
		return
	}

	s.writeJSON(w, http.StatusOK, found)
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Inspect the %v detail in the response and server logs for the underlying store error
  2. Verify the store backend is healthy and reachable from the discovery server
  3. If deserialization of a stored record fails, delete/repair the corrupt record in the store
  4. Retry with backoff for transient connectivity issues
Defensive patterns

Strategy: fallback

Validate before calling

// Distinguish 404 (not found) from 500 (store failure) so callers can fall back gracefully
ep, err := client.GetDiscoveryEndpoint(ctx, universe, ns, name)
if err != nil {
    var httpErr *HTTPError
    if errors.As(err, &httpErr) && httpErr.StatusCode == http.StatusInternalServerError {
        // store read failed; use cached endpoint if available
    }
    return err
}

Type guard

func isStoreReadFailure(err error) bool {
    var httpErr *HTTPError
    return errors.As(err, &httpErr) &&
        httpErr.StatusCode == http.StatusInternalServerError &&
        strings.Contains(httpErr.Body, "Error getting endpoint")
}

Try / catch

ep, err := client.GetDiscoveryEndpoint(ctx, universe, ns, name)
if err != nil {
    if isStoreReadFailure(err) {
        if cached != nil {
            return cached // fall back to last known endpoint
        }
        return fmt.Errorf("store unavailable: %w", err)
    }
    return err // includes 404 NotFound, handle separately
}

Prevention

When it happens

Trigger: GET .../universes/{universe}/namespaces/{ns}/discoveryendpoints/{name} where the store lookup errors out: backend unreachable, query/context cancelled, store deserialization failure, or permission denial at the storage layer.

Common situations: Discovery server cannot reach its storage backend; corrupted stored record that fails to deserialize; read credentials revoked; timeouts under load between server and store.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/15ee2b77742211e6. Report an issue: GitHub.