influxdata/influxdb · error · Error::RequestSizeExceeded
max request size ( bytes) exceeded
Error message
max request size ({0} bytes) exceeded What it means
`Error::RequestSizeExceeded` is returned when the client sends a request body larger than the server's configured maximum; the message includes the byte limit. This protects the server from unbounded memory use when buffering bodies.
Solutions
- Split the payload into smaller batches and send multiple requests
- Increase the server's maximum request size configuration option and restart
- Enable gzip Content-Encoding on the client to shrink the transmitted body below the cap
- Check that the client isn't accidentally double-counting or resending buffered data
Example fix
// before
client.post(url).body(entire_1gb_file) // > max_request_size
// after
for chunk in chunks(entire_1gb_file, 10_000_000) {
client.post(url).body(chunk).send()?;
} Defensive patterns
Strategy: validation
Validate before calling
if (Buffer.byteLength(payload) > 10_000_000) throw new Error('split batch before send: exceeds 10MB limit'); Try / catch
try { await send(batch); } catch (e) { if (String(e).includes('max request size')) { for (const part of split(batch)) await send(part); } else throw e; } Prevention
- Batch writes below the configured max request size
- Configure max_request_size to match your workload on the server
- Use gzip compression to shrink large payloads
- Monitor batch sizes in producers with a hard cap
When it happens
Trigger: POSTing a very large line-protocol batch or query payload that exceeds `max_request_size` (the server's configured body-size cap), e.g. bulk-loading a multi-hundred-MB file in a single request.
Common situations: Bulk data migrations sent as one giant request, misconfigured max body size on the server (default too low for your batch sizes), or compression failing so the raw payload is sent instead of the gzip stream.
Understand the failure class
Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.
Related errors
- arrow error
- Authorization header was malformed, the request was not in…
- body content is not valid utf8
- Cannot parse the given human time
- Cannot parse the timestamp
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/787f599df4ec6003.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_server/src/http.rs:224
/// The `Content-Type` header is invalid and cannot be read.
#[error("invalid content-type header: {0}")]
NonUtf8ContentTypeHeader(hyper::header::ToStrError),
/// The specified `Content-Encoding` is not acceptable.
#[error("unacceptable content-encoding: {0}")]
InvalidContentEncoding(String),
/// The specified `Content-Type` is not acceptable.
#[error("unacceptable content-type, expected: {expected}")]
InvalidContentType { expected: mime::Mime },
/// The client disconnected.
#[error("client disconnected")]
ClientHangup(Box<dyn std::error::Error + Send + Sync>),
/// The client sent a request body that exceeds the configured maximum.
#[error("max request size ({0} bytes) exceeded")]
RequestSizeExceeded(usize),
/// Decoding a gzip-compressed stream of data failed.
#[error("error decoding gzip stream: {0}")]
InvalidGzip(std::io::Error),
#[error("invalid mime type ({0})")]
InvalidMimeType(String),
/// DatabaseName validation error.
#[error("error validating database name: {0}")]
InvalidDatabaseName(#[from] DatabaseNameError),
/// Failure to decode the provided line protocol.
#[error("failed to parse line protocol: {0}")]
ParseLineProtocol(influxdb_line_protocol::Error),
/// The router is currently servicing the maximum permitted number ofView on GitHub (pinned to 06200ef96b)