{"record":{"id":"2ae5fa7344d7d90b","repo":"ruvnet/ruflo","slug":"zstd-decompression-is-not-supported-in-this-enviro","errorCode":null,"errorMessage":"zstd decompression is not supported in this environment","messagePattern":"zstd decompression is not supported in this environment","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/rvfa-format.ts","lineNumber":429,"sourceCode":"    if (!sec) {\n      throw new Error(`Section \"${id}\" not found`);\n    }\n\n    if (sec.offset + sec.size > this.buf.length - SHA256_SIZE) {\n      throw new Error(`Section \"${id}\" exceeds buffer bounds`);\n    }\n\n    const raw = this.buf.subarray(sec.offset, sec.offset + sec.size);\n\n    if (sec.compression === 'gzip') {\n      return gunzipSync(raw);\n    }\n    if (sec.compression === 'zstd') {\n      // zstd not natively supported — attempt gzip fallback (mirrors writer)\n      try {\n        return gunzipSync(raw);\n      } catch {\n        throw new Error(\n          'zstd decompression is not supported in this environment',\n        );\n      }\n    }\n\n    // compression === 'none'\n    return Buffer.from(raw);\n  }\n\n  /**\n   * Verify the integrity of the RVFA image.\n   *\n   * Checks:\n   *  1. Magic bytes\n   *  2. Version number\n   *  3. SHA256 of each section's compressed data\n   *  4. SHA256 footer (all section data combined)\n   */","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/ruvnet/ruflo/blob/6b01dc5a687b26b3e218f796de45ec51f8fa9e8c/v3/@claude-flow/cli/src/appliance/rvfa-format.ts#L411-L447","documentation":"Thrown when a section declares zstd compression and the library's gzip fallback on those bytes also fails. The reader has no native zstd decoder, so zstd-compressed sections cannot be extracted in this environment.","triggerScenarios":"Extracting a section whose header.compression === 'zstd' on a runtime without a zstd-capable zlib, where the best-effort gunzipSync on the zstd payload throws.","commonSituations":"RVFA written by a toolchain that defaults to zstd; older Node without zlib.zstdUncompress; cross-environment image built on a zstd-capable host but extracted elsewhere.","solutions":["Repackage the RVFA with 'gzip' or 'none' compression.","Run extraction on Node 22+ (zlib exposes zstdUncompress) and patch the reader to use it.","Standardize team-wide on a compression every consumer supports."],"exampleFix":"// before (writer)\nsections.push({ id: 'kernel', compression: 'zstd', offset, size });\n\n// after\nsections.push({ id: 'kernel', compression: 'gzip', offset, size });","handlingStrategy":"fallback","validationCode":"const zstdSections = reader.getSections().filter(s => s.compression === 'zstd');\nconst hasZstd = typeof (require('zlib').zstdUncompress) === 'function';\nif (zstdSections.length > 0 && !hasZstd) {\n  throw new Error('RVFA contains zstd sections; rebuild with gzip or run on Node 22+');\n}","typeGuard":null,"tryCatchPattern":"try {\n  return reader.extractSection(id);\n} catch (e) {\n  if (e instanceof Error && /zstd decompression is not supported/.test(e.message)) {\n    // switch to a gzip- or none-compressed image variant\n  }\n  throw e;\n}","preventionTips":["Standardize portable RVFA images on gzip.","Detect zstd sections at validate time, not at extract time.","Pin producer and consumer Node versions when zstd is required."],"tags":["rvfa","compression","zstd","environment"],"backgroundTag":null,"analyzedSha":"6b01dc5a687b26b3e218f796de45ec51f8fa9e8c","analyzedAt":"2026-08-12T13:20:50.148Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}