oven-sh/bun · error · Error

${runtime} server exited before READY

Error message

${runtime} server exited before READY

What it means

After all buffer sections are read, the trailing 8-byte tag must be zero; a nonzero value means the file has extra or garbled bytes at the end (src/install/lockfile/bun.lockb.rs:456-458). The tag exists because Bun < 1.0.4 stopped reading at that point, so newer readers use it to detect appended data.

Source

Thrown at bench/quic/run.mjs:45

const here = new URL(".", import.meta.url).pathname;
const argv = runtime => (runtime === "node" ? ["--experimental-quic", "--no-warnings"] : []);
const bin = runtime => (runtime === "node" ? NODE : BUN);

async function startServer(runtime) {
  const proc = spawn(bin(runtime), [...argv(runtime), `${here}server.mjs`], {
    env: { ...process.env, BODY_SIZE },
    stdio: ["ignore", "pipe", "inherit"],
  });
  const rl = createInterface({ input: proc.stdout });
  for await (const line of rl) {
    const m = /^READY (\d+)$/.exec(line);
    if (m) {
      rl.close();
      return { proc, port: m[1] };
    }
  }
  throw new Error(`${runtime} server exited before READY`);
}

async function runClient(runtime, port) {
  const proc = spawn(bin(runtime), [...argv(runtime), `${here}client.mjs`], {
    env: { ...process.env, PORT: port, COUNT, CONCURRENCY },
    stdio: ["ignore", "pipe", "inherit"],
  });
  let out = "";
  proc.stdout.on("data", d => (out += d));
  // Bounded: a pairing that wedges (e.g. the peer tears the session down
  // mid-run) must report, not hang the whole matrix.
  const timer = setTimeout(() => proc.kill("SIGKILL"), Number(process.env.CLIENT_TIMEOUT_MS ?? 60000));
  const [code] = await once(proc, "exit");
  clearTimeout(timer);
  const line = out.trim().split("\n").at(-1);
  if (code !== 0 || !line?.startsWith("{")) {
    throw new Error(`${runtime} client exited ${code}${code === null ? " (timed out)" : ""}`);
  }

View on GitHub (pinned to 8c5296ac45)

Solutions

  1. Restore the lockfile from git
  2. Or delete bun.lockb and run `bun install` to regenerate
  3. Configure git to take one side wholesale for bun.lockb instead of merging contents
Defensive patterns

Strategy: fallback

Prevention

When it happens

Trigger: Bytes appended to or altered within bun.lockb - merge tools concatenating versions, corruption, or a tool modifying the file after Bun wrote it.

Common situations: Binary merge conflicts 'resolved' by concatenation; editor or script touching bun.lockb; storage-level corruption.

Related errors


AI-assisted analysis of oven-sh/bun@8c5296ac45 (2026-08-16). Data as JSON: /api/errors/a94422a49d30e1ae. Report an issue: GitHub.