{"record":{"id":"1adf1e734b283567","repo":"kubernetes/kops","slug":"reading-docker-config-from-stdin-v","errorCode":null,"errorMessage":"reading Docker config from stdin: %v","messagePattern":"reading Docker config from stdin: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_secret_dockerconfig.go","lineNumber":113,"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.DockerConfigPath == \"-\" {\n\t\tdata, err = ConsumeStdin()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Docker config from stdin: %v\", err)\n\t\t}\n\t} else {\n\t\tdata, err = os.ReadFile(options.DockerConfigPath)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"reading Docker config %v: %v\", options.DockerConfigPath, err)\n\t\t}\n\t}\n\n\tvar parsedData map[string]interface{}\n\terr = json.Unmarshal(data, &parsedData)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to parse JSON %v: %v\", options.DockerConfigPath, err)\n\t}\n\n\tsecret := &fi.Secret{\n\t\tData: data,\n\t}\n","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_secret_dockerconfig.go#L95-L131","documentation":"RunCreateSecretDockerConfig reads the Docker config from stdin (path '-') via ConsumeStdin; this wraps that read failing - stdin closed/empty or an I/O error. The secret store client was already built successfully.","triggerScenarios":"Thrown at cmd/kops/create_secret_dockerconfig.go:113 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pipe a valid Docker config JSON into the command, e.g. cat config.json | kops create secret dockerconfig -","Ensure stdin is not closed or redirected incorrectly","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"}