{"record":{"id":"05e97c54f63444bf","repo":"hyperledger/fabric","slug":"request-is-for-channel-s-but-expected-channel-s","errorCode":null,"errorMessage":"request is for channel %s but expected channel %s","messagePattern":"request is for channel (.+?) but expected channel (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/consensus/smartbft/verifier.go","lineNumber":179,"sourceCode":"func (v *Verifier) verifyRequest(rawRequest []byte, noConfigAllowed bool) (types.RequestInfo, error) {\n\treq, err := v.ReqInspector.unwrapReq(rawRequest)\n\tif err != nil {\n\t\treturn types.RequestInfo{}, err\n\t}\n\n\terr = v.AccessController.Evaluate([]*protoutil.SignedData{\n\t\t{Identity: req.sigHdr.Creator, Data: req.envelope.Payload, Signature: req.envelope.Signature},\n\t})\n\tif err != nil {\n\t\treturn types.RequestInfo{}, errors.Wrap(err, \"access denied\")\n\t}\n\n\tif noConfigAllowed && req.chHdr.Type != int32(cb.HeaderType_ENDORSER_TRANSACTION) {\n\t\treturn types.RequestInfo{}, errors.Errorf(\"only endorser transactions can be sent with other transactions\")\n\t}\n\n\tif req.chHdr.ChannelId != v.Channel {\n\t\treturn types.RequestInfo{}, errors.Errorf(\"request is for channel %s but expected channel %s\", req.chHdr.ChannelId, v.Channel)\n\t}\n\n\tswitch req.chHdr.Type {\n\tcase int32(cb.HeaderType_CONFIG):\n\tcase int32(cb.HeaderType_ORDERER_TRANSACTION):\n\t\treturn types.RequestInfo{}, fmt.Errorf(\"orderer transactions are not supported in v3\")\n\tcase int32(cb.HeaderType_ENDORSER_TRANSACTION):\n\tdefault:\n\t\treturn types.RequestInfo{}, errors.Errorf(\"transaction of type %s is not allowed to be included in blocks\", cb.HeaderType_name[req.chHdr.Type])\n\t}\n\n\tif req.chHdr.Type == int32(cb.HeaderType_CONFIG) {\n\t\terr = v.ConfigValidator.ValidateConfig(req.envelope)\n\t\tif err != nil {\n\t\t\tv.Logger.Errorf(\"Error verifying config update: %v\", err)\n\t\t\treturn types.RequestInfo{}, err\n\t\t}\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/consensus/smartbft/verifier.go#L161-L197","documentation":"verifyRequest checks that the request's channel header ChannelId matches the verifier's channel. A mismatch means the envelope was delivered to the wrong channel's request stream and is rejected with the observed vs expected channel names.","triggerScenarios":"A client broadcasting an envelope signed for channel A to the orderer node serving channel B; misconfigured broadcast endpoints in multi-channel networks.","commonSituations":"SDK/envoy routing envelopes to the wrong channel; copy-paste of channel names in tooling; a node joined to multiple channels receiving fan-out traffic on the wrong stream.","solutions":["Point the client's broadcast at the correct channel for the envelope","Re-create the envelope with the intended ChannelId in its channel header","Fix routing/proxy configuration so envelopes reach the matching channel's orderer service"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if req.chHdr.ChannelId != expectedChannel {\n    return fmt.Errorf(\"envelope for %s cannot be sent to %s\", req.chHdr.ChannelId, expectedChannel)\n}","typeGuard":"func envelopeMatchesChannel(hdr *common.ChannelHeader, ch string) bool {\n    return hdr.ChannelId == ch\n}","tryCatchPattern":"if _, err := VerifyRequest(req); err != nil {\n    if strings.Contains(err.Error(), \"but expected channel\") {\n        // fix client routing / re-target broadcast\n    }\n}","preventionTips":["Double-check channel names in client configuration","Verify envelope headers before broadcast","Use per-channel endpoints in SDK/proxy config"],"tags":["hyperledger-fabric","smartbft","channel-id","routing"],"backgroundTag":"channel-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"}