{"record":{"id":"96aefb83d422ffcd","repo":"kubernetes/kops","slug":"reading-cilium-ipsec-config-from-stdin-v","errorCode":null,"errorMessage":"reading Cilium IPSec config from stdin: %v","messagePattern":"reading Cilium IPSec config from stdin: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_secret_ciliumpassword.go","lineNumber":108,"sourceCode":"\tif err != nil {\n\t\treturn err\n\t}\n\n\tclientset, err := f.KopsClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tsecretStore, err := clientset.SecretStore(cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvar data []byte\n\tif options.CiliumPasswordFilePath == \"-\" {\n\t\tdata, err = ConsumeStdin()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Cilium IPSec config from stdin: %v\", err)\n\t\t}\n\t} else {\n\t\tdata, err = os.ReadFile(options.CiliumPasswordFilePath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Cilium IPSec config %v: %v\", options.CiliumPasswordFilePath, err)\n\t\t}\n\t}\n\n\tvar parsedData map[string]interface{}\n\terr = kops.ParseRawYaml(data, &parsedData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse YAML %v: %v\", options.CiliumPasswordFilePath, err)\n\t}\n\n\tsecret := &fi.Secret{\n\t\tData: data,\n\t}\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_secret_ciliumpassword.go#L90-L126","documentation":"This error wraps a failure from ConsumeStdin() when `kops create secret ciliumpassword -f -` reads the Cilium IPsec configuration from standard input. The stdin stream could not be read to completion, so the secret is not created.","triggerScenarios":"Running `kops create secret ciliumpassword <cluster> -f -` and ConsumeStdin fails — stdin is closed, the pipe producer errored mid-stream, or the read was interrupted.","commonSituations":"Piping from a command that failed partway (`cmd | kops create secret ... -f -`); running non-interactively with no stdin attached; Ctrl-C during entry; CI jobs without stdin.","solutions":["Ensure a producer is actually piping data: `cat config.yaml | kops create secret ciliumpassword ... -f -`.","Check the upstream command's exit status — its failure is the wrapped cause.","Use a real file instead: `kops create secret ciliumpassword <cluster> -f cilium-config.yaml`.","In CI, provide stdin or switch to the file-based invocation."],"exampleFix":"// before (no stdin attached, fails in CI)\nkops create secret ciliumpassword cluster.example.com -f -\n// after\nkops create secret ciliumpassword cluster.example.com -f cilium-ipsec.yaml","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := run(\"kops\", \"create\", \"secret\", \"ciliumpassword\", cluster, \"-f\", \"-\")\nif err != nil && strings.Contains(err.Error(), \"reading Cilium IPSec config from stdin\") {\n    // fall back to file-based invocation\n    return run(\"kops\", \"create\", \"secret\", \"ciliumpassword\", cluster, \"-f\", configFile)\n}","preventionTips":["Prefer the file-based -f <path> form over stdin in scripts/CI.","Check the upstream command's exit code before piping into kOps.","Ensure stdin is a pipe or tty, not closed/empty."],"tags":["stdin","io","cli"],"backgroundTag":"stdin-read-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}