{"record":{"id":"da65bd4f7cee46e8","repo":"headroomlabs-ai/headroom","slug":"failed-to-decompress-gzip-request-body-exc","errorCode":null,"errorMessage":"Failed to decompress gzip request body: {exc}","messagePattern":"Failed to decompress gzip request body: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"headroom/proxy/helpers.py","lineNumber":2418,"sourceCode":"\n            dctx = zstandard.ZstdDecompressor()\n            reader = dctx.stream_reader(raw)\n            raw = reader.read()\n            reader.close()\n        except ImportError:\n            raise ValueError(\n                \"Request body is zstd-compressed but the 'zstandard' package is not installed. \"\n                \"Install it with: pip install zstandard\"\n            ) from None\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress zstd request body: {exc}\") from exc\n    elif encoding == \"gzip\":\n        import gzip as _gzip\n\n        try:\n            raw = _gzip.decompress(raw)\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress gzip request body: {exc}\") from exc\n    elif encoding == \"deflate\":\n        import zlib\n\n        try:\n            raw = zlib.decompress(raw)\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress deflate request body: {exc}\") from exc\n    elif encoding == \"br\":\n        try:\n            import brotli\n\n            raw = brotli.decompress(raw)\n        except ImportError:\n            raise ValueError(\n                \"Request body is brotli-compressed but the 'brotli' package is not installed.\"\n            ) from None\n        except Exception as exc:\n            raise ValueError(f\"Failed to decompress brotli request body: {exc}\") from exc","sourceCodeStart":2400,"sourceCodeEnd":2436,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/proxy/helpers.py#L2400-L2436","documentation":"Error \"Failed to decompress gzip request body: {exc}\" thrown in headroomlabs-ai/headroom.","triggerScenarios":"Raised when gunzipping a request body fails, typically a corrupt payload or a mislabeled Content-Encoding header.","commonSituations":"See trigger scenarios.","solutions":["Check the underlying exception {exc} — corrupt or truncated gzip data is the usual cause","Verify the client set Content-Encoding: gzip only on actually-gzipped bodies","Retry the request to rule out truncation during upload","Validate a captured body with `gunzip -t`"],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}