{"record":{"id":"c0392ab454f7d7f0","repo":"crowdsecurity/crowdsec","slug":"w-w","errorCode":null,"errorMessage":"%w: %w","messagePattern":"%w: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/acquisition/modules/kubernetes/run.go","lineNumber":220,"sourceCode":"\t\tTailLines:  &tailLines,\n\t})\n\tfn := func() error {\n\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn nil\n\t\t}\n\t\tstream, err := req.Stream(ctx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer stream.Close()\n\n\t\tsc := bufio.NewScanner(stream)\n\t\tfor sc.Scan() {\n\t\t\tif err := ctx.Err(); err != nil {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\tif err := onLineFunc(sc.Text(), ns+\"/\"+pod+\"/\"+container, out); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%w: %w\", errProcessLine, err)\n\t\t\t}\n\t\t}\n\t\tif ctx.Err() != nil {\n\t\t\treturn nil\n\t\t}\n\t\treturn sc.Err()\n\t}\n\tfor {\n\t\terr := fn()\n\t\tif err != nil {\n\t\t\tif errors.Is(err, errProcessLine) {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\t// Stream open failure or a scanner/connection error: log and retry\n\t\t\t// below instead of giving up, to survive transient API server\n\t\t\t// disconnects.\n\t\t\ts.logger.Warnf(\"error following logs for %s/%s/%s, retrying: %s\", ns, pod, container, err)\n\t\t}","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/crowdsecurity/crowdsec/blob/909b5157986a2b2c2163300fdaef5ed01289f7d2/pkg/acquisition/modules/kubernetes/run.go#L202-L238","documentation":"The pod log streaming loop wraps line-processing failures with the errProcessLine sentinel via '%w: %w' so the retry loop can distinguish per-line errors (bad event, channel issues) from transport errors of the log stream itself.","triggerScenarios":"Thrown at pkg/acquisition/modules/kubernetes/run.go:220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped inner error for the actual line-processing failure","Fix the parser/log processing that returned the inner error"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"909b5157986a2b2c2163300fdaef5ed01289f7d2","analyzedAt":"2026-09-06T12:27:26.012Z","contentChangedAt":"2026-09-06T12:27:26.012Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}