{"record":{"id":"73fc675b970d0113","repo":"hyperledger/fabric","slug":"specified-channelid-s-does-not-match-channel-id-73fc67","errorCode":null,"errorMessage":"specified --channelID %s does not match channel ID %s in config update envelope","messagePattern":"specified --channelID (.+?) does not match channel ID (.+?) in config update envelope","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/osnadmin/main.go","lineNumber":246,"sourceCode":"\treturn nil\n}\n\nfunc validateEnvelopeChannelID(envelopeBytes []byte, channelID string) error {\n\tenvelope := &common.Envelope{}\n\terr := proto.Unmarshal(envelopeBytes, envelope)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unmarshalling envelope: %s\", err)\n\t}\n\n\tenvelopeChannelID, err := protoutil.GetChannelIDFromEnvelope(envelope)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// quick sanity check that the orderer admin is joining\n\t// the channel they think they're joining.\n\tif channelID != envelopeChannelID {\n\t\treturn fmt.Errorf(\"specified --channelID %s does not match channel ID %s in config update envelope\", channelID, envelopeChannelID)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":228,"sourceCodeEnd":251,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/cmd/osnadmin/main.go#L228-L251","documentation":"validateEnvelopeChannelID checks that the channel ID embedded in the config update envelope equals --channelID. A mismatch means you're applying an update for a different channel than the one named on the command line.","triggerScenarios":"`osnadmin channel update --channelID A --configUpdateEnvelope <envelope for channel B>`.","commonSituations":"Reusing an anchor-peer update envelope from another channel, editing --channelID by hand, or generating the envelope with the wrong --channelID passed to configtxgen.","solutions":["Make --channelID match the envelope's embedded channel ID.","Regenerate the envelope with configtxgen using the correct --channelID.","Re-export/re-select the correct envelope file.","Check for case-sensitivity or whitespace in --channelID."],"exampleFix":"// before\nosnadmin channel update --channelID channel1 --configUpdateEnvelope channel2_anchor.pb\n// after\nosnadmin channel update --channelID channel2 --configUpdateEnvelope channel2_anchor.pb","handlingStrategy":"validation","validationCode":"// verify envelope channel before update\nenv := &common.Envelope{}\nif err := proto.Unmarshal(envBytes, env); err != nil { return err }\nenvCh, err := protoutil.GetChannelIDFromEnvelope(env)\nif err != nil { return err }\nif envCh != targetChannelID {\n    return fmt.Errorf(\"envelope is for %s, want %s\", envCh, targetChannelID)\n}","typeGuard":null,"tryCatchPattern":"if err := runOsnadmin(); err != nil {\n    if strings.Contains(err.Error(), \"does not match channel ID\") {\n        log.Fatalf(\"--channelID disagrees with envelope contents: %v\", err)\n    }\n}","preventionTips":["Pass the same --channelID to configtxgen and osnadmin.","Store envelopes per-channel in separate directories.","Check channel ID case-sensitivity.","Re-generate anchor-peer updates when adding channels."],"tags":["validation","channel","hyperledger-fabric"],"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"}