{"record":{"id":"79d92d92c396261f","repo":"ruvnet/ruflo","slug":"section-id-not-found","errorCode":null,"errorMessage":"Section \"${id}\" not found","messagePattern":"Section \"(.+?)\" not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/appliance/rvfa-format.ts","lineNumber":412,"sourceCode":"  getHeader(): RvfaHeader {\n    return this.header;\n  }\n\n  /** List all sections declared in the header. */\n  getSections(): RvfaSection[] {\n    return this.header.sections;\n  }\n\n  /**\n   * Extract and decompress a section by its id.\n   *\n   * @param id  The section identifier (e.g. 'kernel', 'runtime').\n   * @returns   The decompressed section payload.\n   */\n  extractSection(id: string): Buffer {\n    const sec = this.header.sections.find((s) => s.id === id);\n    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',","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/appliance/rvfa-format.ts#L394-L430","documentation":"extractSection(id) could not find any header.sections[] entry whose id equals the requested string. The lookup is exact and case-sensitive; there is no fallback id. Typical ids written by RvfaWriter are 'kernel', 'runtime', 'ruflo' — but ids are arbitrary strings chosen by whoever built the image.","triggerScenarios":"reader.extractSection('runtime') on an image whose sections are named differently (e.g. 'app', 'rootfs'); a typo or casing mismatch ('Kernel' vs 'kernel'); extracting from a minimal image built with addSection only once. Note extraction happens after fromBuffer succeeded, so the image itself is fine.","commonSituations":"Consumer code assuming a fixed section inventory that a newer image build renamed or split; scripts iterating a hardcoded id list against heterogeneous images; casing/whitespace drift between build and deploy scripts.","solutions":["List what actually exists first: reader.getSections().map((s) => s.id) — then extract by a real id","Align the id with the writer: addSection('runtime', ...) writes exactly 'runtime'; keep build and extract sites in sync","If consuming third-party images, feature-detect required sections and degrade gracefully instead of hardcoding ids","Check for exact-match traps: ids are case-sensitive and not trimmed"],"exampleFix":"// before — hardcoded id\nconst runtime = reader.extractSection('Runtime');\n\n// after — resolve against declared sections\nconst ids = reader.getSections().map((s) => s.id);\nconst id = ids.find((i) => i.toLowerCase() === 'runtime');\nif (!id) throw new Error(`no runtime section; image has: ${ids.join(', ')}`);\nconst runtime = reader.extractSection(id);","handlingStrategy":"validation","validationCode":"const ids = reader.getSections().map((s) => s.id);\nif (!ids.includes('runtime')) {\n  throw new Error(`image lacks 'runtime'; available: ${ids.join(', ')}`);\n}","typeGuard":"function hasSection(reader: { getSections(): Array<{ id: string }> }, id: string): boolean {\n  return reader.getSections().some((s) => s.id === id);\n}","tryCatchPattern":"try { const data = reader.extractSection(id); }\ncatch (e) {\n  if (/Section \".+\" not found/.test(String((e as Error).message))) {\n    // list reader.getSections() and pick the right id\n  }\n  throw e;\n}","preventionTips":["Always enumerate getSections() before extracting from heterogeneous images","Keep addSection ids and extractSection ids as shared constants","Ids are case-sensitive — don't normalize on only one side"],"tags":["rvfa","section-lookup","binary-format"],"backgroundTag":"missing-archive-section","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}