{"record":{"id":"7ffa6372faa5f794","repo":"hyperledger/fabric","slug":"no-channel-id-provided","errorCode":null,"errorMessage":"no channel id provided","messagePattern":"no channel id provided","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/gateway/evaluate.go","lineNumber":139,"sourceCode":"\theader, err := protoutil.UnmarshalHeader(proposal.GetHeader())\n\tif err != nil {\n\t\treturn \"\", \"\", false, err\n\t}\n\tchannelHeader, err := protoutil.UnmarshalChannelHeader(header.GetChannelHeader())\n\tif err != nil {\n\t\treturn \"\", \"\", false, err\n\t}\n\tpayload, err := protoutil.UnmarshalChaincodeProposalPayload(proposal.GetPayload())\n\tif err != nil {\n\t\treturn \"\", \"\", false, err\n\t}\n\tspec, err := protoutil.UnmarshalChaincodeInvocationSpec(payload.GetInput())\n\tif err != nil {\n\t\treturn \"\", \"\", false, err\n\t}\n\n\tif len(channelHeader.GetChannelId()) == 0 {\n\t\treturn \"\", \"\", false, fmt.Errorf(\"no channel id provided\")\n\t}\n\n\tif spec.GetChaincodeSpec() == nil {\n\t\treturn \"\", \"\", false, fmt.Errorf(\"no chaincode spec is provided, channel id [%s]\", channelHeader.GetChannelId())\n\t}\n\n\tif spec.GetChaincodeSpec().GetChaincodeId() == nil {\n\t\treturn \"\", \"\", false, fmt.Errorf(\"no chaincode id is provided, channel id [%s]\", channelHeader.GetChannelId())\n\t}\n\n\tif len(spec.GetChaincodeSpec().GetChaincodeId().GetName()) == 0 {\n\t\treturn \"\", \"\", false, fmt.Errorf(\"no chaincode name is provided, channel id [%s]\", channelHeader.GetChannelId())\n\t}\n\n\treturn channelHeader.GetChannelId(), spec.GetChaincodeSpec().GetChaincodeId().GetName(), len(payload.TransientMap) > 0, nil\n}\n\nfunc getResultFromProposalResponse(proposalResponse *peer.ProposalResponse) ([]byte, error) {","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/gateway/evaluate.go#L121-L157","documentation":"Returned by getChannelAndChaincodeFromSignedProposal (internal/pkg/gateway/evaluate.go:139) when the parsed channel header's ChannelId is empty. A valid signed proposal must carry the channel the transaction targets. The gateway rejects proposals without a channel id since it cannot route the evaluation.","triggerScenarios":"Evaluate called with a signed proposal whose inner ChannelHeader lacks a ChannelId — e.g. the proposal was built without setting the channel ID, or the header was constructed incompletely.","commonSituations":"Constructing a ChaincodeInvocationSpec/Proposal manually and omitting ChannelHeader.ChannelId; copying a header template without filling in the channel; tests with dummy headers.","solutions":["Set the ChannelId in the ChannelHeader when building the proposal (channelHeader.ChannelId = \"mychannel\").","Regenerate the proposal using the SDK/gateway helpers that populate the channel header automatically.","Inspect the proposal with protoutil.UnmarshalChannelHeader to confirm what the client actually sent.","Ensure the client SDK version matches the Fabric version so headers serialize correctly."],"exampleFix":"// before\nchannelHeader := &common.ChannelHeader{TxId: txID} // no channel id\n// after\nchannelHeader := &common.ChannelHeader{TxId: txID, ChannelId: \"mychannel\"}","handlingStrategy":"validation","validationCode":"func validateChannelId(sp *peer.SignedProposal) error {\n    proposal, err := protoutil.UnmarshalProposal(sp.GetProposalBytes())\n    if err != nil {\n        return err\n    }\n    header, err := protoutil.UnmarshalHeader(proposal.GetHeader())\n    if err != nil {\n        return err\n    }\n    ch, err := protoutil.UnmarshalChannelHeader(header.GetChannelHeader())\n    if err != nil {\n        return err\n    }\n    if ch.GetChannelId() == \"\" {\n        return errors.New(\"proposal channel header missing channel id\")\n    }\n    return nil\n}","typeGuard":"func hasChannelId(ch *common.ChannelHeader) bool {\n    return ch != nil && ch.GetChannelId() != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always set ChannelHeader.ChannelId when constructing proposals.","Use gateway client proposal builders instead of manual header assembly.","Decode and inspect the proposal header in debug logs before submitting.","Keep the channel name in config, not hardcoded or defaulted to empty string."],"tags":["validation","fabric-gateway","channel"],"backgroundTag":"missing-required-argument","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"}