{"record":{"id":"4e95b8de1e56bb69","repo":"kubernetes/kops","slug":"reading-encryption-config-from-stdin-v","errorCode":null,"errorMessage":"reading encryption config from stdin: %v","messagePattern":"reading encryption config from stdin: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_secret_encryptionconfig.go","lineNumber":106,"sourceCode":"\tcluster, err := GetCluster(ctx, f, options.ClusterName)\n\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\tvar data []byte\n\tif options.EncryptionConfigPath == \"-\" {\n\t\tdata, err = ConsumeStdin()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading encryption config from stdin: %v\", err)\n\t\t}\n\t} else {\n\t\tdata, err = os.ReadFile(options.EncryptionConfigPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading encryption config %v: %v\", options.EncryptionConfigPath, 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.EncryptionConfigPath, err)\n\t}\n\n\tsecret := &fi.Secret{\n\t\tData: data,\n\t}\n","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_secret_encryptionconfig.go#L88-L124","documentation":"RunCreateSecretEncryptionConfig reads the encryption configuration from stdin (path '-') via ConsumeStdin; this wraps that read failing - stdin closed/empty or an I/O error. The cluster and secret store client were already resolved.","triggerScenarios":"Thrown at cmd/kops/create_secret_encryptionconfig.go:106 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pipe a valid encryption provider config into the command via stdin","Ensure stdin is not closed or incorrectly redirected","Use a file path instead of '-' if not piping"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}