{"record":{"id":"1ad59e3a20d8fd1c","repo":"hyperledger/fabric","slug":"getchaincodeaction-error-s-1ad59e","errorCode":null,"errorMessage":"GetChaincodeAction error %s","messagePattern":"GetChaincodeAction error (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v20/validation_logic.go","lineNumber":164,"sourceCode":"\n\tcap, err := protoutil.UnmarshalChaincodeActionPayload(tx.Actions[actionPosition].Payload)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetChaincodeActionPayload failed, err %s\", err)\n\t\treturn nil, err\n\t}\n\n\tpRespPayload, err := protoutil.UnmarshalProposalResponsePayload(cap.Action.ProposalResponsePayload)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"GetProposalResponsePayload error %s\", err)\n\t\treturn nil, err\n\t}\n\tif pRespPayload.Extension == nil {\n\t\terr = fmt.Errorf(\"nil pRespPayload.Extension\")\n\t\treturn nil, err\n\t}\n\trespPayload, err := protoutil.UnmarshalChaincodeAction(pRespPayload.Extension)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"GetChaincodeAction error %s\", err)\n\t\treturn nil, err\n\t}\n\n\treturn &validationArtifacts{\n\t\trwset:        respPayload.Results,\n\t\tprp:          cap.Action.ProposalResponsePayload,\n\t\tendorsements: cap.Action.Endorsements,\n\t\tchdr:         chdr,\n\t\tenv:          env,\n\t\tpayl:         payl,\n\t\tcap:          cap,\n\t}, nil\n}\n\n// Validate validates the given envelope corresponding to a transaction with an endorsement\n// policy as given in its serialized form.\n// Note that in the case of dependencies in a block, such as tx_n modifying the endorsement policy\n// for key a and tx_n+1 modifying the value of key a, Validate(tx_n+1) will block until Validate(tx_n)","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v20/validation_logic.go#L146-L182","documentation":"Wrap of a protobuf unmarshal failure in extractValidationArtifacts (v2.0 validation logic): the ProposalResponsePayload extension bytes could not be decoded into a ChaincodeAction. It fires during transaction validation when a proposal response payload is malformed or was crafted with a non-ChaincodeAction extension, so response/validation artifacts cannot be extracted.","triggerScenarios":"Extension bytes in a transaction's ProposalResponsePayload are corrupted, truncated, or were produced by a different proto message type / incompatible schema version.","commonSituations":"Proto schema drift between client SDK and peer; a buggy custom endorser marshaling the wrong message into Extension; corrupted block data on disk or in transit.","solutions":["Align fabric-protos versions between the transaction producer and the peer","Rebuild/re-submit the transaction using a supported SDK so ChaincodeAction is marshaled correctly","Check for block-store corruption; verify the block source (snapshot, orderer) is intact","Treat as invalid transaction if it originates from a malicious client — validation code TX_MALFORMED"],"exampleFix":"// before\nprp.Extension = protoutil.MarshalOrPanic(&peer.Response{}) // wrong message type\n// after\nprp.Extension = protoutil.MarshalOrPanic(&peer.ChaincodeAction{\n    Results: rwsetBytes,\n    Response: &peer.Response{Status: 200},\n})","handlingStrategy":"validation","validationCode":"ca := &peer.ChaincodeAction{}\nif err := proto.Unmarshal(prp.Extension, ca); err != nil {\n    return fmt.Errorf(\"extension is not a valid ChaincodeAction\")\n}","typeGuard":"func isValidChaincodeAction(b []byte) bool {\n    ca := &peer.ChaincodeAction{}\n    return proto.Unmarshal(b, ca) == nil && ca.Results != nil\n}","tryCatchPattern":"artifacts, err := extractValidationArtifacts(bytes, policy)\nif err != nil {\n    if strings.Contains(err.Error(), \"GetChaincodeAction error\") {\n        return nil, validationerrors.TXMalformed\n    }\n    return nil, err\n}","preventionTips":["Marshal Extension as &peer.ChaincodeAction only","Align proto schema versions across the network","Verify block-store integrity if corruption is suspected","Reject malformed txs at endorsement/ingestion time"],"tags":["fabric","protobuf","unmarshal","transaction"],"backgroundTag":"protobuf-unmarshal-failed","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"}