{"record":{"id":"0585b2ecab37f70e","repo":"influxdata/influxdb","slug":"unacceptable-content-encoding-0","errorCode":null,"errorMessage":"unacceptable content-encoding: {0}","messagePattern":"unacceptable content-encoding: (.+?)","errorType":"http","errorClass":"Error::InvalidContentEncoding","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":212,"sourceCode":"pub enum Error {\n    /// The requested path has no registered handler.\n    #[error(\"not found\")]\n    NoHandler,\n\n    /// The request body content is not valid utf8.\n    #[error(\"body content is not valid utf8: {0}\")]\n    NonUtf8Body(Utf8Error),\n\n    /// The `Content-Encoding` header is invalid and cannot be read.\n    #[error(\"invalid content-encoding header: {0}\")]\n    NonUtf8ContentEncodingHeader(hyper::header::ToStrError),\n\n    /// The `Content-Type` header is invalid and cannot be read.\n    #[error(\"invalid content-type header: {0}\")]\n    NonUtf8ContentTypeHeader(hyper::header::ToStrError),\n\n    /// The specified `Content-Encoding` is not acceptable.\n    #[error(\"unacceptable content-encoding: {0}\")]\n    InvalidContentEncoding(String),\n\n    /// The specified `Content-Type` is not acceptable.\n    #[error(\"unacceptable content-type, expected: {expected}\")]\n    InvalidContentType { expected: mime::Mime },\n\n    /// The client disconnected.\n    #[error(\"client disconnected\")]\n    ClientHangup(Box<dyn std::error::Error + Send + Sync>),\n\n    /// The client sent a request body that exceeds the configured maximum.\n    #[error(\"max request size ({0} bytes) exceeded\")]\n    RequestSizeExceeded(usize),\n\n    /// Decoding a gzip-compressed stream of data failed.\n    #[error(\"error decoding gzip stream: {0}\")]\n    InvalidGzip(std::io::Error),\n","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L194-L230","documentation":"`Error::InvalidContentEncoding` is returned when the request's `Content-Encoding` value is readable but not an encoding the server accepts (it embeds the offending value). The server only decodes a small allowlist, chiefly gzip, and treats the body as-is otherwise.","triggerScenarios":"Sending a body compressed or labelled with an unsupported encoding, e.g. `Content-Encoding: br`, `deflate`, `zstd`, or a misspelled value like `gzipp`, while the server only handles gzip/identity.","commonSituations":"HTTP clients with default compression (brotli) enabled, servers/CDN layers adding zstd compression, or hand-written clients that set the header but use a different algorithm than declared.","solutions":["Compress the body with gzip and set `Content-Encoding: gzip`, or send it uncompressed without the header","Disable brotli/deflate/zstd compression in your HTTP client for this request","Fix the header spelling — the value must match exactly what the server accepts","Check intermediate proxies that might re-encode the payload"],"exampleFix":"// before\nheaders.set('Content-Encoding', 'br');\n// after\nimport zlib from 'zlib';\nconst body = zlib.gzipSync(payload);\nheaders.set('Content-Encoding', 'gzip');","handlingStrategy":"validation","validationCode":"const SUPPORTED_ENCODINGS = new Set(['gzip','identity']);\nif (contentEncoding && !SUPPORTED_ENCODINGS.has(contentEncoding)) throw new Error('unsupported encoding: ' + contentEncoding);","typeGuard":null,"tryCatchPattern":"try { await send(); } catch (e) { if (String(e).includes('unacceptable content-encoding')) { await sendUncompressed(); } else throw e; }","preventionTips":["Only declare Content-Encoding: gzip when you actually gzip the body","Disable brotli/zstd defaults in HTTP clients for this API","Send identity/uncompressed unless the server documents other encodings","Check CDN/proxy compression settings"],"tags":["http","compression","gzip","content-encoding"],"backgroundTag":"invalid-argument-value","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}