{"record":{"id":"6614e6be8fb298f5","repo":"hyperledger/fabric","slug":"error-reading-original-config","errorCode":null,"errorMessage":"error reading original config","messagePattern":"error reading original config","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/configtxlator/main.go","lineNumber":196,"sourceCode":"\t}\n\n\terr = proto.Unmarshal(in, msg)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error unmarshalling\")\n\t}\n\n\terr = protolator.DeepMarshalJSON(output, msg)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error encoding output\")\n\t}\n\n\treturn nil\n}\n\nfunc computeUpdt(original, updated, output *os.File, channelID string) error {\n\torigIn, err := io.ReadAll(original)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error reading original config\")\n\t}\n\n\torigConf := &cb.Config{}\n\terr = proto.Unmarshal(origIn, origConf)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error unmarshalling original config\")\n\t}\n\n\tupdtIn, err := io.ReadAll(updated)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error reading updated config\")\n\t}\n\n\tupdtConf := &cb.Config{}\n\terr = proto.Unmarshal(updtIn, updtConf)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"error unmarshalling updated config\")\n\t}","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/cmd/configtxlator/main.go#L178-L214","documentation":"computeUpdt reads the original config proto with io.ReadAll and wraps failures as \"error reading original config\". This is an OS-level read error on the file given as the original configuration, not a content-format problem.","triggerScenarios":"--original path unreadable: bad permissions, missing file, closed pipe, or unmounted volume inside a container.","commonSituations":"Comparing configs where the original was regenerated with restrictive permissions (e.g. by root in a container), or a script passed a stale temp-file path.","solutions":["Verify the original file exists and is readable (ls -l, test -r)","Fix permissions or re-export the original config from the ordering service","In containers, mount the directory containing both config files","Re-run the command with the correct path"],"exampleFix":"// before\nconfigtxlator compute-update --channel myc --original orig.pb ...\n// after\ntest -r orig.pb && configtxlator compute-update --channel myc --original orig.pb ...","handlingStrategy":"validation","validationCode":"if [ ! -r \"$ORIGINAL\" ] || [ ! -s \"$ORIGINAL\" ]; then echo \"original config missing/unreadable\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check readability of both config inputs before compute-update","Regenerate original config with sane permissions","Keep original and updated files in the same mounted directory"],"tags":["io","file","configtxlator","fabric"],"backgroundTag":"file-read-failed","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}