{"record":{"id":"f5b00e0e612e7530","repo":"hyperledger/fabric","slug":"configupdate-for-channel-s-but-envelope-for-cha","errorCode":null,"errorMessage":"ConfigUpdate for channel '%s' but envelope for channel '%s'","messagePattern":"ConfigUpdate for channel '(.+?)' but envelope for channel '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/configtx/update.go","lineNumber":127,"sourceCode":"\t\t}\n\t}\n\treturn nil\n}\n\n// 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)","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/configtx/update.go#L109-L145","documentation":"The channel ID inside the ConfigUpdate does not match the channel this validator was created for. An update envelope is only valid for its intended channel; a mismatch means the envelope was built for, or is being validated against, the wrong channel.","triggerScenarios":"Calling proposeConfigUpdate/Validate with a ConfigUpdateEnvelope whose ConfigUpdate.channel_id differs from vi.channelID — e.g. submitting an update generated for channel A to the validator of channel B.","commonSituations":"Mixing up update files when operating multiple channels; copying an example update and forgetting to change channel_id; using a fetched config from one channel to build an update submitted to another.","solutions":["Regenerate the update with the correct channel_id matching the target channel (configtxlator / configtxgen -channelID).","Verify you are submitting the update transaction to the intended channel (peer channel update -c <channel>).","Re-fetch the current config from the correct channel and rebuild the diff."],"exampleFix":"// before\n{\"channel_id\": \"channel-a\", ...}\n// after\n{\"channel_id\": \"mychannel\", ...}","handlingStrategy":"validation","validationCode":"// Confirm the update's channel matches the target before submitting\nfunc checkChannel(update *cb.ConfigUpdate, channelID string) error {\n    if update.GetChannelId() != channelID {\n        return fmt.Errorf(\"update targets %q, expected %q\", update.GetChannelId(), channelID)\n    }\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if _, err := validator.ProposeConfigUpdate(env, seq); err != nil {\n    if strings.Contains(err.Error(), \"but envelope for channel\") {\n        // rebuild update for the correct channel before retry\n    }\n    return err\n}","preventionTips":["Parameterize scripts by channel name; never hardcode channel IDs from examples.","Fetch the base config from the same channel the update is submitted to.","Store update files named by channel (e.g. mychannel-update.pb) to avoid mixups.","Print the ConfigUpdate channel_id in CI before submission."],"tags":["hyperledger-fabric","configtx","channel-id","mismatch"],"backgroundTag":"channel-id-mismatch","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"}