{"record":{"id":"a94422a49d30e1ae","repo":"oven-sh/bun","slug":"runtime-server-exited-before-ready","errorCode":null,"errorMessage":"${runtime} server exited before READY","messagePattern":"(.+?) server exited before READY","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bench/quic/run.mjs","lineNumber":45,"sourceCode":"\nconst here = new URL(\".\", import.meta.url).pathname;\nconst argv = runtime => (runtime === \"node\" ? [\"--experimental-quic\", \"--no-warnings\"] : []);\nconst bin = runtime => (runtime === \"node\" ? NODE : BUN);\n\nasync function startServer(runtime) {\n  const proc = spawn(bin(runtime), [...argv(runtime), `${here}server.mjs`], {\n    env: { ...process.env, BODY_SIZE },\n    stdio: [\"ignore\", \"pipe\", \"inherit\"],\n  });\n  const rl = createInterface({ input: proc.stdout });\n  for await (const line of rl) {\n    const m = /^READY (\\d+)$/.exec(line);\n    if (m) {\n      rl.close();\n      return { proc, port: m[1] };\n    }\n  }\n  throw new Error(`${runtime} server exited before READY`);\n}\n\nasync function runClient(runtime, port) {\n  const proc = spawn(bin(runtime), [...argv(runtime), `${here}client.mjs`], {\n    env: { ...process.env, PORT: port, COUNT, CONCURRENCY },\n    stdio: [\"ignore\", \"pipe\", \"inherit\"],\n  });\n  let out = \"\";\n  proc.stdout.on(\"data\", d => (out += d));\n  // Bounded: a pairing that wedges (e.g. the peer tears the session down\n  // mid-run) must report, not hang the whole matrix.\n  const timer = setTimeout(() => proc.kill(\"SIGKILL\"), Number(process.env.CLIENT_TIMEOUT_MS ?? 60000));\n  const [code] = await once(proc, \"exit\");\n  clearTimeout(timer);\n  const line = out.trim().split(\"\\n\").at(-1);\n  if (code !== 0 || !line?.startsWith(\"{\")) {\n    throw new Error(`${runtime} client exited ${code}${code === null ? \" (timed out)\" : \"\"}`);\n  }","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/quic/run.mjs#L27-L63","documentation":"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.","triggerScenarios":"Bytes appended to or altered within bun.lockb - merge tools concatenating versions, corruption, or a tool modifying the file after Bun wrote it.","commonSituations":"Binary merge conflicts 'resolved' by concatenation; editor or script touching bun.lockb; storage-level corruption.","solutions":["Restore the lockfile from git","Or delete bun.lockb and run `bun install` to regenerate","Configure git to take one side wholesale for bun.lockb instead of merging contents"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve bun.lockb conflicts by taking one side, never concatenating","Do not append to or edit bun.lockb with scripts","Restore from git when in doubt"],"tags":["lockfile","corruption"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}