{"record":{"id":"49650b85cb3723df","repo":"cilium/cilium","slug":"failed-to-get-logs-from-hubble-relay-pods","errorCode":null,"errorMessage":"failed to get logs from Hubble Relay pods","messagePattern":"failed to get logs from Hubble Relay pods","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cilium-cli/sysdump/sysdump.go","lineNumber":1516,"sourceCode":"\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to get logs from Hubble pods\")\n\t\t\t\t}\n\t\t\t\tif err := c.SubmitLogsTasks(FilterPods(p, c.NodeList), c.Options.LogsSinceTime, c.Options.LogsLimitBytes); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect logs from Hubble pods\")\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tCreatesSubtasks: true,\n\t\t\tDescription:     \"Collecting logs from Hubble Relay pods\",\n\t\t\tQuick:           false,\n\t\t\tTask: func(ctx context.Context) error {\n\t\t\t\tp, err := c.Client.ListPods(ctx, c.Options.CiliumNamespace, metav1.ListOptions{\n\t\t\t\t\tLabelSelector: c.Options.HubbleRelayLabelSelector,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to get logs from Hubble Relay pods\")\n\t\t\t\t}\n\t\t\t\tif err := c.SubmitLogsTasks(AllPods(p), c.Options.LogsSinceTime, c.Options.LogsLimitBytes); err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to collect logs from Hubble Relay pods\")\n\t\t\t\t}\n\t\t\t\treturn nil\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tCreatesSubtasks: true,\n\t\t\tDescription:     \"Collecting logs from Hubble UI pods\",\n\t\t\tQuick:           false,\n\t\t\tTask: func(ctx context.Context) error {\n\t\t\t\tp, err := c.Client.ListPods(ctx, c.Options.CiliumNamespace, metav1.ListOptions{\n\t\t\t\t\tLabelSelector: c.Options.HubbleUILabelSelector,\n\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"failed to get logs from Hubble UI pods\")\n\t\t\t\t}","sourceCodeStart":1498,"sourceCodeEnd":1534,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/sysdump/sysdump.go#L1498-L1534","documentation":"The sysdump task for Hubble Relay logs lists pods using HubbleRelayLabelSelector in the Cilium namespace. A failure of the ListPods API call is reported as this static message with the real cause discarded. It means Hubble Relay pods could not be enumerated, so their logs were not collected.","triggerScenarios":"c.Client.ListPods(ctx, c.Options.CiliumNamespace, metav1.ListOptions{LabelSelector: c.Options.HubbleRelayLabelSelector}) returns an error in the 'Collecting logs from Hubble Relay pods' task (sysdump.go:1512-1516).","commonSituations":"Hubble Relay not installed / namespace typo so label selector queries fail or RBAC blocks listing; expired kubeconfig or disconnected VPN; API server instability during sysdump runs.","solutions":["Verify access: kubectl get pods -n <cilium-namespace> -l k8s-app=hubble-relay works.","Correct the --cilium-namespace flag to the namespace where Hubble Relay is deployed.","Check RBAC: kubectl auth can-i list pods -n <cilium-namespace>.","Retry the sysdump after restoring cluster connectivity."],"exampleFix":"// before\nreturn fmt.Errorf(\"failed to get logs from Hubble Relay pods\")\n// after\nreturn fmt.Errorf(\"failed to get logs from Hubble Relay pods: %w\", err)","handlingStrategy":"try-catch","validationCode":"pods, _ := clientset.CoreV1().Pods(ciliumNamespace).List(ctx, metav1.ListOptions{LabelSelector: hubbleSelector})\nfor _, p := range pods.Items {\n    if p.Status.Phase != corev1.PodRunning {\n        log.Warnf(\"Hubble pod %s not Running; log collection may fail\", p.Name)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := task(ctx); err != nil && strings.Contains(err.Error(), \"failed to collect logs from Hubble pods\") {\n    log.Warn(\"Hubble log collection failed; check pod health, node filtering, and log limits\")\n}","preventionTips":["Confirm Hubble pods are Running/ready before collecting.","Ensure the node list used by cilium-cli matches actual cluster nodes.","Use sane --logs-limit-bytes and logs-since settings.","Diagnose with kubectl logs on individual Hubble pods."],"tags":["kubernetes","sysdump","hubble-relay","pod-listing"],"backgroundTag":"kubernetes-api-error","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}