Warren
Error

PRECONDITION_FAILED - message size is larger than configured max size: RabbitMQ's 16 MiB limit

2026-11-13 · 2 min read · Viktor Baumann

PRECONDITION_FAILED - message size 16777217 is larger than configured max size 16777216

RabbitMQ refuses a message whose body is larger than max_message_size, 16 MiB (16777216 bytes) by default on RabbitMQ 4. It does so by closing the channel with reply code 406. Measured on RabbitMQ 4.3.6 with pika 1.4.4; 16777216 bytes went through, one byte more did not. The broker log:

[error] operation basic.publish caused a channel exception precondition_failed: message size 16777217 is larger than configured max size 16777216

What the publisher notices

PublisherResult
with publisher confirmsbasic_publish raised ChannelClosedByBroker: (406, 'PRECONDITION_FAILED - message size …')
without confirmsbasic_publish returned without error; the channel was closed a moment later
without confirms, next publish right afteralso returned without error, and that message was lost as well
without confirms, next publish 0.2 s laterraised the error above

Without confirms the publish call only writes to the socket, so the refusal arrives after the call has returned. Whatever the application publishes on that channel before it notices is gone too: in our test a small order-2 sent straight after the large one never reached the queue.

The fix

[error] max_message_size invalid, Max message size should be between 0 and 512MB
[error] BOOT FAILED