{"record":{"id":"08bf123288dcee50","repo":"cilium/cilium","slug":"failed-to-submit-metrics-task-for-q-w","errorCode":null,"errorMessage":"failed to submit metrics task for %q: %w","messagePattern":"failed to submit metrics task for %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cilium-cli/sysdump/sysdump.go","lineNumber":3130,"sourceCode":"\t\tif !podIsRunningAndHasContainer(p, containerName) {\n\t\t\tcontinue\n\t\t}\n\t\terr := c.Pool.Submit(fmt.Sprintf(\"metrics-%s-%s-%s\", p.Name, containerName, portName), func(ctx context.Context) error {\n\t\t\tport, err := getPodMetricsPort(p, containerName, portName)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to collect metrics: %w - this is expected if prometheus metrics are disabled\", err)\n\t\t\t}\n\t\t\trsp, err := c.Client.ProxyGet(ctx, p.Namespace, fmt.Sprintf(\"%s:%d\", p.Name, port), \"metrics\")\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to collect metrics: %w\", err)\n\t\t\t}\n\t\t\tif err := c.WriteString(fmt.Sprintf(metricsFileName, p.Name, containerName), rsp); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to collect metrics: %w\", err)\n\t\t\t}\n\t\t\treturn nil\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to submit metrics task for %q: %w\", p.Name, err)\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (c *Collector) submitCiliumOperatorDbgTasks(pods []*corev1.Pod) error {\n\ttasks := []struct {\n\t\tname string\n\t\text  string\n\t\targs []string\n\t}{\n\t\t{\n\t\t\tname: \"statedb-dump\",\n\t\t\text:  \"json\",\n\t\t\targs: []string{\"shell\", \"db/dump\"},\n\t\t},\n\t\t{\n\t\t\tname: \"status-clustermesh\",","sourceCodeStart":3112,"sourceCodeEnd":3148,"githubUrl":"https://github.com/cilium/cilium/blob/ac7b90affa4baf0642e6685319d56907b3a73a6d/cilium-cli/sysdump/sysdump.go#L3112-L3148","documentation":"Outer wrapped error from the cilium-cli sysdump when submitting the per-pod metrics collection task to the worker pool fails, or when the task body returned any of the inner metrics errors (1045-1047). The pod name is included for context.","triggerScenarios":"After c.Pool.Submit(\"metrics-<pod>-<container>-<port>\", ...) returns non-nil, the collector wraps it with this message; the cause may be a port-lookup, ProxyGet, or WriteString failure.","commonSituations":"Sysdump runs where one agent pod's metrics collection failed; because tasks run concurrently, several pods can report this independently.","solutions":["Unwrap to find the inner cause (port lookup vs scrape vs write)","If the cause is the 'expected if prometheus metrics are disabled' error, enable metrics or ignore","Fix RBAC/disk issues identified in the wrapped error","Re-run cilium-cli sysdump"],"exampleFix":"// before\nreturn fmt.Errorf(\"failed to submit metrics task for %q: %w\", p.Name, err)\n// after\nif isExpectedMetricsErr(err) {\n    c.logDebug(\"metrics collection skipped for pod %s: %v\", p.Name, err)\n    return nil\n}\nreturn fmt.Errorf(\"failed to submit metrics task for %q: %w\", p.Name, err)","handlingStrategy":"try-catch","validationCode":"// skip submission when the container has no metrics port\nif !hasMetricsPort(p, containerName, portName) { continue }","typeGuard":"func isExpectedMetricsErr(err error) bool {\n    return strings.Contains(err.Error(), \"expected if prometheus metrics are disabled\")\n}","tryCatchPattern":"if err := c.Pool.Submit(taskName, task); err != nil {\n    if isExpectedMetricsErr(err) {\n        c.logDebug(\"metrics skipped for pod %s: %v\", p.Name, err)\n        continue\n    }\n    return fmt.Errorf(\"failed to submit metrics task for %q: %w\", p.Name, err)\n}","preventionTips":["Inspect the unwrapped cause before failing the whole sysdump","Filter out pods without the metrics port before submitting","Enable metrics cluster-wide to avoid expected failures","Log-and-continue for optional per-pod collectors"],"tags":["cilium-cli","sysdump","metrics","task-pool"],"backgroundTag":"task-submission-wrapped-error","analyzedSha":"ac7b90affa4baf0642e6685319d56907b3a73a6d","analyzedAt":"2026-08-31T18:27:15.868Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}