{"record":{"id":"9a2e0bc8767a5e17","repo":"hyperledger/fabric","slug":"only-endorser-transactions-are-supported-provided","errorCode":null,"errorMessage":"Only Endorser Transactions are supported, provided type %d","messagePattern":"Only Endorser Transactions are supported, provided type (.+?)","errorType":"validation","errorClass":"VSCCEndorsementPolicyError","httpStatus":null,"severity":"error","filePath":"core/handlers/validation/builtin/v12/validation_logic.go","lineNumber":136,"sourceCode":"\t\treturn policyErr(err)\n\t}\n\n\t// ...and the payload...\n\tpayl, err := protoutil.UnmarshalPayload(env.Payload)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetPayload failed, err %s\", err)\n\t\treturn policyErr(err)\n\t}\n\n\tchdr, err := protoutil.UnmarshalChannelHeader(payl.Header.ChannelHeader)\n\tif err != nil {\n\t\treturn policyErr(err)\n\t}\n\n\t// validate the payload type\n\tif common.HeaderType(chdr.Type) != common.HeaderType_ENDORSER_TRANSACTION {\n\t\tlogger.Errorf(\"Only Endorser Transactions are supported, provided type %d\", chdr.Type)\n\t\treturn policyErr(fmt.Errorf(\"Only Endorser Transactions are supported, provided type %d\", chdr.Type))\n\t}\n\n\t// ...and the transaction...\n\ttx, err := protoutil.UnmarshalTransaction(payl.Data)\n\tif err != nil {\n\t\tlogger.Errorf(\"VSCC error: GetTransaction failed, err %s\", err)\n\t\treturn policyErr(err)\n\t}\n\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 policyErr(err)\n\t}\n\n\tsignatureSet, err := vscc.deduplicateIdentity(cap)\n\tif err != nil {\n\t\treturn policyErr(err)","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/handlers/validation/builtin/v12/validation_logic.go#L118-L154","documentation":"VSCC's Validate() only processes transactions whose envelope header type is ENDORSER_TRANSACTION. If the header type is any other value (e.g. CONFIG, CONFIG_UPDATE, PEER_RESOURCE_UPDATE, or an undefined numeric type), validation fails with this message wrapped in a policy error so the transaction is marked invalid.","triggerScenarios":"Submitting a non-endorser envelope (e.g. a raw config update or a tampered transaction whose chdr.Type was altered) to the transaction validation path; a client marshaling an envelope with an incorrect Type field.","commonSituations":"Hand-crafted envelopes in tools or tests that set the wrong header type; replaying admin config-update messages through the transaction path; malicious or corrupted payloads on the wire.","solutions":["Ensure clients create envelopes via protoutil.CreateSignedTx with HeaderType_ENDORSER_TRANSACTION","If validating a config-style transaction, route it through the config validation path instead of VSCC","Inspect the offending envelope's chdr.Type (the number is in the message) and correct the producer code"],"exampleFix":"// before\nchdr.Type = int32(common.HeaderType_CONFIG)\nenv, _ := protoutil.CreateSignedTx(prop, signer, res)\n// after\nchdr.Type = int32(common.HeaderType_ENDORSER_TRANSACTION)\nenv, _ := protoutil.CreateSignedTx(prop, signer, res)","handlingStrategy":"validation","validationCode":"chdr, err := protoutil.UnmarshalChannelHeader(payload.Header)\nif err != nil { return err }\nif common.HeaderType(chdr.Type) != common.HeaderType_ENDORSER_TRANSACTION {\n    return fmt.Errorf(\"refusing to submit: header type %d is not ENDORSER_TRANSACTION\", chdr.Type)\n}","typeGuard":null,"tryCatchPattern":"if txerr := txr.ValidationCode; txerr != pt.And \n// typical handling: inspect invalid transaction reason on commit event\nfor r := range notifier {\n    if r.Code != pb.TxValidationCode_VALID {\n        log.Printf(\"tx %s invalid: %v\", r.TxId, r.Code)\n    }\n}","preventionTips":["Always build transactions with the SDK/protoutil.CreateSignedTx, never raw envelopes","Never repurpose or overwrite chdr.Type when reusing envelopes","Route config updates through the config path, not the transaction path"],"tags":["go","transaction-validation","vscc","header-type"],"backgroundTag":"invalid-transaction-type","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"}