kubesphere/kubesphere · error

cluster connection config %s not found

Error message

cluster connection config %s not found

What it means

After passing name validation, the Secret named after the requested platform config (in the KubeSphere namespace, key ClusterConnectionConfigFileName) could not be fetched: the wrapped error is a Kubernetes API failure other than NotFound (which is handled separately), e.g. RBAC denial, timeout, or server error.

Source

Thrown at pkg/kapis/config/v1alpha2/handler.go:184

	_ = resp.WriteEntity(lists)
}

func (h *handler) getClusterConnectionConfiguration(req *restful.Request, resp *restful.Response) {
	configName := req.PathParameter("config")
	if len(validation.IsDNS1123Label(configName)) > 0 {
		api.HandleNotFound(resp, req, fmt.Errorf("platform config %s not found", configName))
		return
	}

	secret := &corev1.Secret{
		ObjectMeta: metav1.ObjectMeta{
			Namespace: constants.KubeSphereNamespace,
			Name:      configName,
		},
	}
	if err := h.client.Get(req.Request.Context(), client.ObjectKeyFromObject(secret), secret); err != nil {
		if apierrors.IsNotFound(err) {
			api.HandleNotFound(resp, req, fmt.Errorf("cluster connection config %s not found", configName))
			return
		}
		api.HandleError(resp, req, err)
		return
	}

	config := ClusterConnectionConfiguration{
		TypeMeta: metav1.TypeMeta{
			Kind:       ClusterConnectionConfigurationKind,
			APIVersion: APIVersion,
		},
		ObjectMeta: metav1.ObjectMeta{
			UID:               secret.UID,
			Name:              secret.Name,
			ResourceVersion:   secret.ResourceVersion,
			CreationTimestamp: secret.CreationTimestamp,
		},
	}

View on GitHub (pinned to 04a29b5c60)

Solutions

  1. Check the wrapped error for RBAC or connectivity problems against the platform cluster
  2. Confirm the Secret <configName> exists in the KubeSphere namespace
  3. Verify apiserver service account permissions for reading Secrets
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/kapis/config/v1alpha2/handler.go:184 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubesphere/kubesphere@04a29b5c60 (2026-09-03). Data as JSON: /api/errors/ed64780f041ce814. Report an issue: GitHub.