{"record":{"id":"9e3fd1c28d04313b","repo":"cilium/cilium","slug":"unable-to-list-same-node-pods-w","errorCode":null,"errorMessage":"unable to list same node pods: %w","messagePattern":"unable to list same node pods: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/connectivity/check/deployment.go","lineNumber":2976,"sourceCode":"\t}\n\n\tfor _, pod := range clientPods.Items {\n\t\tif strings.Contains(pod.Name, clientCPDeployment) {\n\t\t\tct.clientCPPods[pod.Name] = Pod{\n\t\t\t\tK8sClient: ct.client,\n\t\t\t\tPod:       pod.DeepCopy(),\n\t\t\t}\n\t\t} else {\n\t\t\tct.clientPods[pod.Name] = Pod{\n\t\t\t\tK8sClient: ct.client,\n\t\t\t\tPod:       pod.DeepCopy(),\n\t\t\t}\n\t\t}\n\t}\n\n\tsameNodePods, err := ct.clients.src.ListPods(ctx, ct.params.TestNamespace, metav1.ListOptions{LabelSelector: \"name=\" + echoSameNodeDeploymentName})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to list same node pods: %w\", err)\n\t}\n\tsameNodePodItems := k8s.LivePods(sameNodePods.Items)\n\tif len(sameNodePodItems) != 1 {\n\t\treturn fmt.Errorf(\"unexpected number of same node pods: %d\", len(sameNodePodItems))\n\t}\n\tsameNodePod := Pod{\n\t\tPod: sameNodePodItems[0].DeepCopy(),\n\t}\n\n\tfor _, cp := range ct.clientPods {\n\t\terr := WaitForPodDNS(ctx, ct, cp, sameNodePod)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tif !ct.params.SingleNode || ct.params.MultiCluster != \"\" {\n\t\totherNodePods, err := ct.clients.dst.ListPods(ctx, ct.params.TestNamespace, metav1.ListOptions{LabelSelector: \"name=\" + echoOtherNodeDeploymentName})","sourceCodeStart":2958,"sourceCodeEnd":2994,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/connectivity/check/deployment.go#L2958-L2994","documentation":"The test lists same-node echo pods by the name=<echoSameNodeDeploymentName> label via the source cluster client to build the sameNode endpoint. This error wraps the ListPods failure with %w. Note that even a successful list with zero pods raises a separate 'unexpected number of same node pods' error — this specific error is purely the API-level failure.","triggerScenarios":"ct.clients.src.ListPods(ctx, TestNamespace, metav1.ListOptions{LabelSelector: \"name=\" + echoSameNodeDeploymentName}) returns non-nil: RBAC denial in the source cluster, source cluster API unreachable (common in multi-cluster runs), or namespace deleted.","commonSituations":"Multi-cluster setups where the source cluster context/token has expired mid-run; clustermesh disconnected so the src client can't reach the remote API; RBAC restricted profiles blocking pod listing.","solutions":["Check the wrapped cause and run kubectl --context <src> -n <TestNamespace> get pods -l name=<echo-same-node>","In multi-cluster runs, verify clustermesh connectivity and the source cluster kubeconfig are valid","Confirm pods list RBAC in the source cluster's test namespace","Re-run the test; if the same-node echo deployment never started, also check its deployment events"],"exampleFix":"// before\nError: unable to list same node pods: Get \"https://remote-api\": x509: certificate has expired\n// after\ncilium-cli clustermesh status   # verify remote cluster connectivity\n# refresh source kubeconfig / renew clustermesh certs, then re-run","handlingStrategy":"try-catch","validationCode":"kubectl --context <src> auth can-i list pods -n <TestNamespace>\nkubectl --context <src> get ns <TestNamespace>\ncilium-cli clustermesh status   # in multi-cluster setups, confirm src connectivity","typeGuard":null,"tryCatchPattern":"sameNodePods, err := ct.clients.src.ListPods(ctx, ns, metav1.ListOptions{LabelSelector: \"name=\" + echoSameNodeDeploymentName})\nif err != nil {\n    if apierrors.IsNotFound(err) || x509Err(err) || connectionErr(err) {\n        return fmt.Errorf(\"source cluster unreachable/deployment missing: %w\", err)\n    }\n    return fmt.Errorf(\"same-node pod listing failed: %w\", err)\n}\nif len(sameNodePods.Items) != 1 {\n    return fmt.Errorf(\"expected exactly 1 same-node echo pod, got %d\", len(sameNodePods.Items))\n}","preventionTips":["Validate clustermesh connectivity before multi-cluster test runs","Ensure the source cluster kubeconfig/token is valid for the whole run duration","Confirm the echo-same-node deployment is scheduled (check deployment events) to distinguish list failures from zero-pod states"],"tags":["kubernetes","cilium-cli","pods","multi-cluster"],"backgroundTag":"kubernetes-pod-list-forbidden","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}