{"record":{"id":"cd596a3648124a72","repo":"kubernetes/kops","slug":"reading-docker-config-v-v","errorCode":null,"errorMessage":"reading Docker config %v: %v","messagePattern":"reading Docker config (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/kops/create_secret_dockerconfig.go","lineNumber":118,"sourceCode":"\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\n\tif !options.Force {\n\t\t_, created, err := secretStore.GetOrCreateSecret(ctx, \"dockerconfig\", secret)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"adding dockerconfig secret: %v\", err)\n\t\t}","sourceCodeStart":100,"sourceCodeEnd":136,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/cmd/kops/create_secret_dockerconfig.go#L100-L136","documentation":"Wraps os.ReadFile failure while loading the Docker config JSON for `kops create secret dockerconfig`. It fires when the file at --docker-config (options.DockerConfigPath) cannot be read — typically the path does not exist, is a directory, or lacks read permission; the underlying OS error is appended to the message. The '-' (stdin) path produces a different error.","triggerScenarios":"Thrown at cmd/kops/create_secret_dockerconfig.go:118 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the file path passed via --dockerconfig exists","Check file read permissions","Use '-' to read the config from stdin instead"],"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"}