hyperledger/fabric · error · VSCCEndorsementPolicyError
VSCC error: invocation of lscc(%s) does not have appropriate
Error message
VSCC error: invocation of lscc(%s) does not have appropriate arguments
What it means
After unmarshaling the ChaincodeDeploymentSpec, VSCC checks that the spec, its ChaincodeSpec, ChaincodeId, the ChaincodeActionPayload action and its ProposalResponsePayload are all non-nil. Any missing piece means the lscc invocation is structurally incomplete, so the transaction is rejected as a policy error.
Source
Thrown at core/handlers/validation/builtin/v12/validation_logic.go:534
logger.Debugf("VSCC info: validating invocation of lscc function %s on arguments %#v", lsccFunc, lsccArgs)
if len(lsccArgs) < 2 {
return policyErr(fmt.Errorf("Wrong number of arguments for invocation lscc(%s): expected at least 2, received %d", lsccFunc, len(lsccArgs)))
}
if (!ac.PrivateChannelData() && len(lsccArgs) > 5) ||
(ac.PrivateChannelData() && len(lsccArgs) > 6) {
return policyErr(fmt.Errorf("Wrong number of arguments for invocation lscc(%s): received %d", lsccFunc, len(lsccArgs)))
}
cdsArgs, err := protoutil.UnmarshalChaincodeDeploymentSpec(lsccArgs[1])
if err != nil {
return policyErr(fmt.Errorf("GetChaincodeDeploymentSpec error %s", err))
}
if cdsArgs == nil || cdsArgs.ChaincodeSpec == nil || cdsArgs.ChaincodeSpec.ChaincodeId == nil ||
cap.Action == nil || cap.Action.ProposalResponsePayload == nil {
return policyErr(fmt.Errorf("VSCC error: invocation of lscc(%s) does not have appropriate arguments", lsccFunc))
}
switch cdsArgs.ChaincodeSpec.Type.String() {
case "GOLANG", "NODE", "JAVA", "CAR":
default:
return policyErr(fmt.Errorf("unexpected chaincode spec type: %s", cdsArgs.ChaincodeSpec.Type.String()))
}
// validate chaincode name
ccName := cdsArgs.ChaincodeSpec.ChaincodeId.Name
// it must comply with the lscc.ChaincodeNameRegExp
if !lscc.ChaincodeNameRegExp.MatchString(ccName) {
return policyErr(errors.Errorf("invalid chaincode name '%s'", ccName))
}
// it can't match the name of one of the system chaincodes
if _, in := systemChaincodeNames[ccName]; in {
return policyErr(errors.Errorf("chaincode name '%s' is reserved for system chaincodes", ccName))
}View on GitHub (pinned to 2736b63f8f)
Solutions
- Ensure the signed ChaincodeActionPayload includes a ProposalResponsePayload with a non-nil Action (use protoutil.GetProposalResponsePayload helpers when building the transaction).
- Confirm ChaincodeDeploymentSpec.ChaincodeSpec.ChaincodeId (name/version/path) is populated before submitting the deploy/upgrade.
- Update the SDK or transaction-building code to a version that correctly assembles the full action payload.
Example fix
// before: submitting action without proposal response payload
cap.Action = nil
// after: attach the endorsed proposal response payload
cap.Action = &pb.ChaincodeEndorsedAction{
ProposalResponsePayload: prpBytes,
Endorsements: endorsements,
} Defensive patterns
Strategy: validation
Validate before calling
if cds == nil || cds.ChaincodeSpec == nil || cds.ChaincodeSpec.ChaincodeId == nil ||
cap.Action == nil || cap.Action.ProposalResponsePayload == nil {
return errors.New("incomplete lscc invocation payload")
} Type guard
func hasCompleteLsccPayload(cds *pb.ChaincodeDeploymentSpec, cap *pb.ChaincodeActionPayload) bool {
return cds != nil && cds.ChaincodeSpec != nil && cds.ChaincodeSpec.ChaincodeId != nil &&
cap != nil && cap.Action != nil && cap.Action.ProposalResponsePayload != nil
} Try / catch
if !hasCompleteLsccPayload(cdsArgs, cap) {
logger.Warn("lscc invocation missing spec/action payload; rejecting")
return policyErr(errors.New("incomplete lscc invocation"))
} Prevention
- Use the SDK's canonical transaction assembly instead of hand-building ChaincodeActionPayload.
- Assert ChaincodeId name/version are set before deploy.
- Never strip or rebuild ProposalResponsePayload bytes in intermediaries.
When it happens
Trigger: An lscc transaction whose deployment spec lacks ChaincodeSpec/ChaincodeId, or whose ChaincodeActionPayload has a nil Action or nil Action.ProposalResponsePayload — e.g. an endorsement response payload was never attached or was stripped.
Common situations: Malformed transactions built by custom scripts or buggy SDK versions that omit the proposal response payload in the action; tampered transactions during commit-time validation; partial payload assembly in custom endorsement flows.
Related errors
- invalid key for the collection of chaincode %s:%s; expected
- collection configuration arguments supplied for chaincode %s
- GetChaincodeDeploymentSpec error %s
- unexpected chaincode spec type: %s
- nil pRespPayload.Extension
AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04).
Data as JSON: /api/errors/59f6bd3f39669512.
Report an issue: GitHub.