hyperledger/fabric · error

message payload is %d bytes and exceeds maximum allowed %d b

Error message

message payload is %d bytes and exceeds maximum allowed %d bytes

What it means

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.

Source

Thrown at orderer/common/msgprocessor/sizefilter.go:41

func NewSizeFilter(resources SizeFilterResources) *MaxBytesRule {
	return &MaxBytesRule{resources: resources}
}

// MaxBytesRule implements the Rule interface.
type MaxBytesRule struct {
	resources SizeFilterResources
}

// Apply returns an error if the message exceeds the configured absolute max batch size.
func (r *MaxBytesRule) Apply(message *common.Envelope) error {
	ordererConf, ok := r.resources.OrdererConfig()
	if !ok {
		logger.Panic("Programming error: orderer config not found")
	}

	maxBytes := ordererConf.BatchSize().AbsoluteMaxBytes
	if size := messageByteSize(message); size > maxBytes {
		return fmt.Errorf("message payload is %d bytes and exceeds maximum allowed %d bytes", size, maxBytes)
	}
	return nil
}

func messageByteSize(message *common.Envelope) uint32 {
	// XXX this is good approximation, but is going to be a few bytes short, because of the field specifiers in the proto marshaling
	// this should probably be padded to determine the true exact marshaled size
	return uint32(len(message.Payload) + len(message.Signature))
}

View on GitHub (pinned to 2736b63f8f)

Solutions

  1. Reduce the message payload size (split large chaincode invocations or use private data)
  2. Raise AbsoluteMaxBytes in the orderer batch size config if the channel genuinely needs larger messages
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at orderer/common/msgprocessor/sizefilter.go:41 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of hyperledger/fabric@2736b63f8f (2026-09-04). Data as JSON: /api/errors/ccd16935d8557dfd. Report an issue: GitHub.