hyperledger/fabric · error · VSCCEndorsementPolicyError
Only Endorser Transactions are supported, provided type %d
Error message
Only Endorser Transactions are supported, provided type %d
What it means
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.
Source
Thrown at core/handlers/validation/builtin/v12/validation_logic.go:136
return policyErr(err)
}
// ...and the payload...
payl, err := protoutil.UnmarshalPayload(env.Payload)
if err != nil {
logger.Errorf("VSCC error: GetPayload failed, err %s", err)
return policyErr(err)
}
chdr, err := protoutil.UnmarshalChannelHeader(payl.Header.ChannelHeader)
if err != nil {
return policyErr(err)
}
// validate the payload type
if common.HeaderType(chdr.Type) != common.HeaderType_ENDORSER_TRANSACTION {
logger.Errorf("Only Endorser Transactions are supported, provided type %d", chdr.Type)
return policyErr(fmt.Errorf("Only Endorser Transactions are supported, provided type %d", chdr.Type))
}
// ...and the transaction...
tx, err := protoutil.UnmarshalTransaction(payl.Data)
if err != nil {
logger.Errorf("VSCC error: GetTransaction failed, err %s", err)
return policyErr(err)
}
cap, err := protoutil.UnmarshalChaincodeActionPayload(tx.Actions[actionPosition].Payload)
if err != nil {
logger.Errorf("VSCC error: GetChaincodeActionPayload failed, err %s", err)
return policyErr(err)
}
signatureSet, err := vscc.deduplicateIdentity(cap)
if err != nil {
return policyErr(err)View on GitHub (pinned to 2736b63f8f)
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
Example fix
// before chdr.Type = int32(common.HeaderType_CONFIG) env, _ := protoutil.CreateSignedTx(prop, signer, res) // after chdr.Type = int32(common.HeaderType_ENDORSER_TRANSACTION) env, _ := protoutil.CreateSignedTx(prop, signer, res)
Defensive patterns
Strategy: validation
Validate before calling
chdr, err := protoutil.UnmarshalChannelHeader(payload.Header)
if err != nil { return err }
if common.HeaderType(chdr.Type) != common.HeaderType_ENDORSER_TRANSACTION {
return fmt.Errorf("refusing to submit: header type %d is not ENDORSER_TRANSACTION", chdr.Type)
} Try / catch
if txerr := txr.ValidationCode; txerr != pt.And
// typical handling: inspect invalid transaction reason on commit event
for r := range notifier {
if r.Code != pb.TxValidationCode_VALID {
log.Printf("tx %s invalid: %v", r.TxId, r.Code)
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- VSCC error: endorsement policy failure, err: %s
- stateFetcher not passed in init
- Endorsement policy evaluation failure might be caused by dup
- malformed chaincode invocation spec
- panic(err)
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/9a2e0bc8767a5e17.
Report an issue: GitHub.