{"record":{"id":"4e5d28b39b821eab","repo":"cilium/cilium","slug":"unable-to-determine-status-of-pod-q-w","errorCode":null,"errorMessage":"unable to determine status of pod %q: %w","messagePattern":"unable to determine status of pod %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/clustermesh/clustermesh.go","lineNumber":814,"sourceCode":"\t\t// Additionally skip the configuration of the local cluster, if present\n\t\tif name != k.clusterName && strings.Contains(string(cfg), \"endpoints:\") {\n\t\t\tstats.Clusters[name] = &ClusterStats{}\n\t\t\texpected = append(expected, name)\n\t\t}\n\t}\n\n\tpods, err := k.client.ListPods(ctx, k.params.Namespace, metav1.ListOptions{LabelSelector: selector})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"unable to list pods: %w\", err)\n\t}\n\n\tfor _, pod := range pods.Items {\n\t\ts, err := collector(ctx, pod.Name)\n\t\tif err != nil {\n\t\t\tif len(expected) == 0 && errors.Is(err, status.ErrClusterMeshStatusNotAvailable) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn nil, fmt.Errorf(\"unable to determine status of pod %q: %w\", pod.Name, err)\n\t\t}\n\n\t\tstats.parseAgentStatus(pod.Name, expected, s)\n\t}\n\n\tif len(pods.Items) > 0 {\n\t\tstats.Connected.Avg /= float64(len(pods.Items))\n\t}\n\n\treturn stats, nil\n}\n\nfunc (k *K8sClusterMesh) Status(ctx context.Context) (*Status, error) {\n\terr := k.GetClusterConfig(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":796,"sourceCodeEnd":832,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/clustermesh/clustermesh.go#L796-L832","documentation":"When the per-pod status collector fails for a specific Cilium agent pod, this error wraps the underlying cause along with the pod name. The only tolerated case is ErrClusterMeshStatusNotAvailable when no remote clusters are expected (older agents without clustermesh status support). Any other collector error aborts the whole status operation.","triggerScenarios":"collector(ctx, pod.Name) fails for an agent pod — e.g. the agent's /healthz or status endpoint is unreachable, the pod is being deleted, or exec/port-forward to the pod fails; and it is not an ignorable ErrClusterMeshStatusNotAvailable.","commonSituations":"Agent pod restarting during the check; network policy blocking pod access; mixed Cilium versions where some agents predate clustermesh status reporting; host under heavy load.","solutions":["Check the named pod's health: kubectl -n kube-system get pod <name> and its logs","Retry once the pod is Running/Ready (or pass --wait to retry automatically)","If caused by old Cilium versions lacking status support, upgrade all agents","Verify no policy blocks connectivity between the CLI host and the pod"],"exampleFix":"// before: hard failure on any pod\nreturn nil, fmt.Errorf(\"unable to determine status of pod %q: %w\", pod.Name, err)\n// after: tolerate unavailable-status on old agents\nif errors.Is(err, status.ErrClusterMeshStatusNotAvailable) { continue }","handlingStrategy":"retry","validationCode":"// Ensure the target agent pod is ready first\npod, err := cs.CoreV1().Pods(\"kube-system\").Get(ctx, podName, metav1.GetOptions{})\nif err != nil || !podutil.IsPodReady(pod) { return retryLater }","typeGuard":null,"tryCatchPattern":"if err != nil {\n    if errors.Is(err, status.ErrClusterMeshStatusNotAvailable) { return nil } // old agent, ignore\n    if strings.Contains(err.Error(), \"unable to determine status of pod\") { return retryAfter(ctx, time.Minute) }\n}","preventionTips":["Run status checks only when all agent pods are Ready","Align Cilium versions across clusters so all agents support status reporting","Add small delays around rolling upgrades before collecting status"],"tags":["cilium","pods","health-check","clustermesh"],"backgroundTag":"pod-status-unavailable","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T22:30:34.772Z"}