{"record":{"id":"2ab92b4d4c3d4200","repo":"JuliusBrussee/caveman","slug":"objectstore-decompressed-payload-exceeds-limit","errorCode":null,"errorMessage":"objectstore: decompressed payload exceeds limit","messagePattern":"objectstore: decompressed payload exceeds limit","errorType":"error_code","errorClass":"ErrDecompressedTooLarge","httpStatus":null,"severity":"error","filePath":"shared/platform/objectstore/compress.go","lineNumber":26,"sourceCode":"\t\"io\"\n\n\t\"github.com/klauspost/compress/zstd\"\n)\n\n// Compression names the supported codecs; they mirror the artifacts.compression\n// CHECK constraint (none|gzip|zstd). An unknown codec fails closed.\nconst (\n\tCompressionNone = \"none\"\n\tCompressionGzip = \"gzip\"\n\tCompressionZstd = \"zstd\"\n)\n\nvar (\n\tzstdEnc, _ = zstd.NewWriter(nil)\n\n\t// ErrDecompressedTooLarge is returned before a compressed payload can\n\t// expand beyond the caller's plaintext ceiling.\n\tErrDecompressedTooLarge = errors.New(\"objectstore: decompressed payload exceeds limit\")\n)\n\n// DefaultMaxDecompressedBytes protects callers that do not have trusted size\n// metadata. Callers with an expected plaintext size should use\n// DecompressLimit with the smaller, metadata-validated limit.\nconst DefaultMaxDecompressedBytes int64 = 128 << 20\n\n// Compress encodes data with the named codec. \"none\" returns data unchanged.\nfunc Compress(codec string, data []byte) ([]byte, error) {\n\tswitch codec {\n\tcase CompressionNone, \"\":\n\t\treturn data, nil\n\tcase CompressionGzip:\n\t\tvar buf bytes.Buffer\n\t\tzw := gzip.NewWriter(&buf)\n\t\tif _, err := zw.Write(data); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"gzip: %w\", err)\n\t\t}","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/shared/platform/objectstore/compress.go#L8-L44","documentation":"Error \"objectstore: decompressed payload exceeds limit\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at shared/platform/objectstore/compress.go:26 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the decompressed payload below the limit."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}