ruvnet/ruflo · error

Section " " not found

Error message

Section "${id}" not found

What it means

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.

Solutions

  1. List what actually exists first: reader.getSections().map((s) => s.id) — then extract by a real id
  2. Align the id with the writer: addSection('runtime', ...) writes exactly 'runtime'; keep build and extract sites in sync
  3. If consuming third-party images, feature-detect required sections and degrade gracefully instead of hardcoding ids
  4. Check for exact-match traps: ids are case-sensitive and not trimmed

Example fix

// before — hardcoded id
const runtime = reader.extractSection('Runtime');

// after — resolve against declared sections
const ids = reader.getSections().map((s) => s.id);
const id = ids.find((i) => i.toLowerCase() === 'runtime');
if (!id) throw new Error(`no runtime section; image has: ${ids.join(', ')}`);
const runtime = reader.extractSection(id);
Defensive patterns

Strategy: validation

Validate before calling

const ids = reader.getSections().map((s) => s.id);
if (!ids.includes('runtime')) {
  throw new Error(`image lacks 'runtime'; available: ${ids.join(', ')}`);
}

Type guard

function hasSection(reader: { getSections(): Array<{ id: string }> }, id: string): boolean {
  return reader.getSections().some((s) => s.id === id);
}

Try / catch

try { const data = reader.extractSection(id); }
catch (e) {
  if (/Section ".+" not found/.test(String((e as Error).message))) {
    // list reader.getSections() and pick the right id
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/79d92d92c396261f. Report an issue: GitHub.

Appendix: source

Thrown at v3/@claude-flow/cli/src/appliance/rvfa-format.ts:412

  getHeader(): RvfaHeader {
    return this.header;
  }

  /** List all sections declared in the header. */
  getSections(): RvfaSection[] {
    return this.header.sections;
  }

  /**
   * Extract and decompress a section by its id.
   *
   * @param id  The section identifier (e.g. 'kernel', 'runtime').
   * @returns   The decompressed section payload.
   */
  extractSection(id: string): Buffer {
    const sec = this.header.sections.find((s) => s.id === id);
    if (!sec) {
      throw new Error(`Section "${id}" not found`);
    }

    if (sec.offset + sec.size > this.buf.length - SHA256_SIZE) {
      throw new Error(`Section "${id}" exceeds buffer bounds`);
    }

    const raw = this.buf.subarray(sec.offset, sec.offset + sec.size);

    if (sec.compression === 'gzip') {
      return gunzipSync(raw);
    }
    if (sec.compression === 'zstd') {
      // zstd not natively supported — attempt gzip fallback (mirrors writer)
      try {
        return gunzipSync(raw);
      } catch {
        throw new Error(
          'zstd decompression is not supported in this environment',

View on GitHub (pinned to fa13ee4ad6)