{"record":{"id":"4a3be0b31f22d08c","repo":"hyperledger/fabric","slug":"error-mapping-readset","errorCode":null,"errorMessage":"error mapping ReadSet","messagePattern":"error mapping ReadSet","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/configtx/update.go","lineNumber":132,"sourceCode":"// authorizeUpdate validates that all modified config has the corresponding modification policies satisfied by the signature set\n// it returns a map of the modified config\nfunc (vi *ValidatorImpl) authorizeUpdate(configUpdateEnv *cb.ConfigUpdateEnvelope) (map[string]comparable, error) {\n\tif configUpdateEnv == nil {\n\t\treturn nil, errors.Errorf(\"cannot process nil ConfigUpdateEnvelope\")\n\t}\n\n\tconfigUpdate, err := UnmarshalConfigUpdate(configUpdateEnv.ConfigUpdate)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif configUpdate.ChannelId != vi.channelID {\n\t\treturn nil, errors.Errorf(\"ConfigUpdate for channel '%s' but envelope for channel '%s'\", configUpdate.ChannelId, vi.channelID)\n\t}\n\n\treadSet, err := mapConfig(configUpdate.ReadSet, vi.namespace)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error mapping ReadSet\")\n\t}\n\terr = vi.verifyReadSet(readSet)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error validating ReadSet\")\n\t}\n\n\twriteSet, err := mapConfig(configUpdate.WriteSet, vi.namespace)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"error mapping WriteSet\")\n\t}\n\n\tdeltaSet := computeDeltaSet(readSet, writeSet)\n\tsignedData, err := protoutil.ConfigUpdateEnvelopeAsSignedData(configUpdateEnv)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif err = vi.verifyDeltaSet(deltaSet, signedData); err != nil {","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/configtx/update.go#L114-L150","documentation":"mapConfig failed while converting the update's ReadSet into the internal comparable map. This wraps an underlying error such as a bad group path, an invalid item type, or keys in unexpected positions in the config tree. The ReadSet could not be processed, so authorization stops.","triggerScenarios":"Calling proposeConfigUpdate/Validate with a ConfigUpdate whose ReadSet contains entries with invalid group paths, illegal key encodings, or items that mapConfig cannot classify (e.g. policies/values/groups in wrong positions).","commonSituations":"Manually edited protobuf update files; tooling producing nested group paths that don't mirror the config hierarchy; corrupted update transmitted over the wire.","solutions":["Inspect the wrapped inner error to locate the offending ReadSet entry/path.","Rebuild the ReadSet via configtxlator from the actual current config (ReadSet entries must exist in the current config with matching versions).","Do not hand-edit serialized update protos; regenerate the diff programmatically.","Validate the update JSON/YAML schema before encoding to protobuf."],"exampleFix":"// before: read_set group path \"Application/OrgsMSP\" (wrong segment)\n// after: correct path mirroring config tree, e.g. \"groups/Application/groups/Org1\"","handlingStrategy":"validation","validationCode":"// Sanity-check ReadSet structure before submission\nfunc validReadSet(update *cb.ConfigUpdate) error {\n    rs := update.GetReadSet()\n    for g := range rs.GetGroups() {\n        if g == \"\" { return errors.New(\"read_set has empty group key\") }\n    }\n    for k := range rs.GetValues() {\n        if k == \"\" { return errors.New(\"read_set has empty value key\") }\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if _, err := validator.ProposeConfigUpdate(env, seq); err != nil {\n    if strings.Contains(err.Error(), \"error mapping ReadSet\") {\n        // regenerate read_set from the live config via configtxlator\n    }\n    return err\n}","preventionTips":["Generate read_set entries only from entries that exist in the current config.","Avoid manual edits of the encoded update proto; edit decoded JSON then re-encode.","Validate update JSON against the ConfigUpdate schema before encoding."],"tags":["hyperledger-fabric","configtx","readset","malformed"],"backgroundTag":"readset-mapping-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"}