{"record":{"id":"d72c6795709d10d2","repo":"hyperledger/fabric","slug":"no-chaincode-name-is-provided-channel-id-s","errorCode":null,"errorMessage":"no chaincode name is provided, channel id [%s]","messagePattern":"no chaincode name is provided, channel id \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pkg/gateway/evaluate.go","lineNumber":151,"sourceCode":"\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) {\n\tresponsePayload := &peer.ProposalResponsePayload{}\n\tif err := proto.Unmarshal(proposalResponse.GetPayload(), responsePayload); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to deserialize proposal response payload\")\n\t}\n\n\treturn getResultFromProposalResponsePayload(responsePayload)\n}\n\nfunc getResultFromProposalResponsePayload(responsePayload *peer.ProposalResponsePayload) ([]byte, error) {\n\tchaincodeAction := &peer.ChaincodeAction{}\n\tif err := proto.Unmarshal(responsePayload.GetExtension(), chaincodeAction); err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to deserialize chaincode action\")","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/internal/pkg/gateway/evaluate.go#L133-L169","documentation":"This error comes from the gateway's getChannelAndChaincodeFromSignedProposal. After extracting the signed proposal payload, it checks that the proposal's ChaincodeSpec has a ChaincodeId with a non-empty Name. If the chaincode name is empty or missing, evaluation cannot proceed because the gateway would not know which chaincode to invoke, so it rejects the proposal with this message including the channel id.","triggerScenarios":"Calling gateway Evaluate (or NewEvaluation of an endorsed proposal) with a signed proposal whose ChaincodeProposalPayload's ChaincodeSpec has ChaincodeId set to nil or ChaincodeId.Name empty — e.g. a proposal built manually without setting the chaincode name field.","commonSituations":"Hand-crafting a signed proposal with the protos instead of using a Fabric SDK; an SDK or tool version that serializes ChaincodeId differently (e.g. renamed to 'path' or left unset); copying proposal-building code that sets ChaincodeSpec.Input but forgets ChaincodeSpec.ChaincodeId.Name.","solutions":["Set spec.chaincode_spec.chaincode_id.name to the instantiated chaincode name before signing/calling Evaluate","Use a Fabric SDK (fabric-gateway, fabric-sdk-go/node/java) to build the proposal so chaincode id is populated automatically","Inspect the signed proposal payload with protoc --decode=protos.ChaincodeProposalPayload to verify the ChaincodeId.Name field is present"],"exampleFix":"// before\nspec := &peer.ChaincodeSpec{Input: &peer.ChaincodeInput{Args: args}}\n// after\nspec := &peer.ChaincodeSpec{\n    ChaincodeId: &peer.ChaincodeID{Name: \"mycc\"},\n    Input:       &peer.ChaincodeInput{Args: args},\n}","handlingStrategy":"validation","validationCode":"func validateProposal(spec *peer.ChaincodeSpec) error {\n    if spec.GetChaincodeId() == nil || len(spec.GetChaincodeId().GetName()) == 0 {\n        return fmt.Errorf(\"chaincode spec must include chaincode_id.name\")\n    }\n    return nil\n}","typeGuard":"func hasChaincodeName(spec *peer.ChaincodeSpec) bool {\n    return spec != nil && spec.GetChaincodeId() != nil && spec.GetChaincodeId().GetName() != \"\"\n}","tryCatchPattern":null,"preventionTips":["Always build proposals via an official Fabric SDK which sets ChaincodeId.Name","Unit-test proposal construction to assert chaincode_id.name is non-empty before signing","Never hand-assemble ChaincodeProposalPayload without validating ChaincodeSpec fields"],"tags":["fabric","gateway","proposal","chaincode","validation"],"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"}