{"record":{"id":"ccd16935d8557dfd","repo":"hyperledger/fabric","slug":"message-payload-is-d-bytes-and-exceeds-maximum-al","errorCode":null,"errorMessage":"message payload is %d bytes and exceeds maximum allowed %d bytes","messagePattern":"message payload is (.+?) bytes and exceeds maximum allowed (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"orderer/common/msgprocessor/sizefilter.go","lineNumber":41,"sourceCode":"func NewSizeFilter(resources SizeFilterResources) *MaxBytesRule {\n\treturn &MaxBytesRule{resources: resources}\n}\n\n// MaxBytesRule implements the Rule interface.\ntype MaxBytesRule struct {\n\tresources SizeFilterResources\n}\n\n// Apply returns an error if the message exceeds the configured absolute max batch size.\nfunc (r *MaxBytesRule) Apply(message *common.Envelope) error {\n\tordererConf, ok := r.resources.OrdererConfig()\n\tif !ok {\n\t\tlogger.Panic(\"Programming error: orderer config not found\")\n\t}\n\n\tmaxBytes := ordererConf.BatchSize().AbsoluteMaxBytes\n\tif size := messageByteSize(message); size > maxBytes {\n\t\treturn fmt.Errorf(\"message payload is %d bytes and exceeds maximum allowed %d bytes\", size, maxBytes)\n\t}\n\treturn nil\n}\n\nfunc messageByteSize(message *common.Envelope) uint32 {\n\t// XXX this is good approximation, but is going to be a few bytes short, because of the field specifiers in the proto marshaling\n\t// this should probably be padded to determine the true exact marshaled size\n\treturn uint32(len(message.Payload) + len(message.Signature))\n}\n","sourceCodeStart":23,"sourceCodeEnd":51,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/orderer/common/msgprocessor/sizefilter.go#L23-L51","documentation":"MaxBytesRule.Apply guard: the broadcast envelope's byte size exceeds Orderer.BatchSize.AbsoluteMaxBytes from the channel config. Oversized messages are rejected before cutting into a block to keep blocks within the configured limit.","triggerScenarios":"Thrown at orderer/common/msgprocessor/sizefilter.go:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the message payload size (split large chaincode invocations or use private data)","Raise AbsoluteMaxBytes in the orderer batch size config if the channel genuinely needs larger messages"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}