{"record":{"id":"92bb22f9029f826f","repo":"oven-sh/bun","slug":"not-200","errorCode":null,"errorMessage":"not 200","messagePattern":"not 200","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bench/emitter/realworld_stream.mjs","lineNumber":35,"sourceCode":"  const randomUnder1 = nextInt() / 0x7fffffff; // 2**31 - 1\n  return start + Math.floor(randomUnder1 * rangeSize);\n}\n\nconst chunks = new Array(1024).fill(null).map((_, j) => {\n  const arr = new Uint8Array(1024);\n  for (let i = 0; i < arr.length; i++) {\n    arr[i] = nextRange(0, 256);\n  }\n  return arr;\n});\n\ngroupForEmitter(\"stream simulation\", ({ EventEmitter, name }) => {\n  bench(name, () => {\n    let id = 0;\n    const stream = new EventEmitter();\n\n    stream.on(\"start\", res => {\n      if (res.status !== 200) throw new Error(\"not 200\");\n    });\n\n    const recived = [];\n    stream.on(\"data\", req => {\n      recived.push(req);\n    });\n\n    stream.on(\"end\", ev => {\n      ev.preventDefault();\n    });\n\n    // simulate a stream\n    stream.emit(\"start\", { status: 200 });\n    for (let chunk of chunks) {\n      stream.emit(\"data\", chunk);\n    }\n    stream.emit(\"end\", {\n      preventDefault() {","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/emitter/realworld_stream.mjs#L17-L53","documentation":"Raised while saving/rebuilding the lockfile: `old.root_package()` returned None (src/install/lockfile.rs:968), meaning the loaded lockfile's package list has no root workspace package, so the 'recreate with only alive packages' step cannot proceed.","triggerScenarios":"A bun.lockb/bun.lock whose root package entry (the workspace root at index 0) is missing - typically a hand-edited or binary-merge-mangled lockfile, or one produced by a crashed/aborted earlier install save.","commonSituations":"Resolving merge conflicts directly inside bun.lockb; external tooling rewriting the lockfile; checking out a branch whose lockfile was written by an interrupted install.","solutions":["Delete bun.lockb (and bun.lock if present) and run `bun install` to regenerate from package.json","If it recurs, upgrade Bun - a save-path bug or crashed save could produce it","Ensure no git filters/LFS or scripts rewrite bun.lockb"],"exampleFix":"# before: keep the damaged lockfile and retry\n$ bun install\n\n# after\n$ rm bun.lockb bun.lock 2>/dev/null; bun install","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"const code = Bun.spawnSync([\"bun\", \"install\"]).exitCode;\nif (code !== 0) {\n  await Bun.$`rm -f bun.lockb bun.lock`;\n  await Bun.$`bun install`;\n}","preventionTips":["Never hand-edit bun.lockb; regenerate it with bun install instead","Resolve bun.lockb merge conflicts by taking one side wholesale, never by content-merging","Keep Bun updated so save-path bugs do not produce rootless lockfiles"],"tags":["lockfile","install","corruption"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}