{"record":{"id":"be8db63ad91901c5","repo":"oven-sh/bun","slug":"picsum-p-id-res-status","errorCode":null,"errorMessage":"picsum ${p.id}: ${res.status}","messagePattern":"picsum (.+?): (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"bench/image/visual-compare.mjs","lineNumber":46,"sourceCode":"  { id: 1025, name: \"pug\", note: \"fur detail, shallow DOF\" },\n  { id: 1040, name: \"castle\", note: \"hard architectural edges\" },\n  { id: 1043, name: \"leaves\", note: \"high-frequency green\" },\n  { id: 1056, name: \"road\", note: \"vanishing-point lines\" },\n  { id: 1069, name: \"jellyfish\", note: \"soft gradients on black\" },\n  { id: 1074, name: \"lion\", note: \"fur + bokeh\" },\n  { id: 1080, name: \"strawberries\", note: \"saturated red, seed detail\" },\n  { id: 110, name: \"field\", note: \"sky gradient banding test\" },\n  { id: 237, name: \"puppy\", note: \"dark fur, high contrast\" },\n  { id: 433, name: \"bear\", note: \"fur, snow highlights\" },\n  { id: 660, name: \"city-night\", note: \"point lights, noise\" },\n];\n\nasync function fetchPic(p) {\n  const path = CACHE + `pic_${p.id}.jpg`;\n  if (existsSync(path)) return readFileSync(path);\n  process.stderr.write(`  fetch ${p.name} (#${p.id})… `);\n  const res = await fetch(`https://picsum.photos/id/${p.id}/2400/1600`, { redirect: \"follow\" });\n  if (!res.ok) throw new Error(`picsum ${p.id}: ${res.status}`);\n  const buf = Buffer.from(await res.arrayBuffer());\n  writeFileSync(path, buf);\n  process.stderr.write(`${(buf.length / 1024).toFixed(0)} KB\\n`);\n  return buf;\n}\n\n// ─── synthetic torture patterns (kept; they're where filters visibly differ) ─\nfunction crc32(buf) {\n  let c = ~0 >>> 0;\n  for (let i = 0; i < buf.length; i++) {\n    c ^= buf[i];\n    for (let k = 0; k < 8; k++) c = (c >>> 1) ^ (0xedb88320 & -(c & 1));\n  }\n  return ~c >>> 0;\n}\nfunction pngChunk(type, data) {\n  const out = new Uint8Array(12 + data.length);\n  const dv = new DataView(out.buffer);","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/bench/image/visual-compare.mjs#L28-L64","documentation":"The lockfile could not be parsed at all. For binary bun.lockb: wrong magic header (src/install/lockfile/bun.lockb.rs:405-406), a package meta id out of range (447-449), or later structural read failures (498/527/767/840). It is also the catch-all for text bun.lock parse errors and pnpm-lock.yaml migration failures (src/install/error.rs:441, 451).","triggerScenarios":"bun.lockb replaced by merge-conflict garbage or another tool; a file that is not a lockfile at that path; a partially written binary lockfile; migrating a pnpm lockfile with unsupported structure.","commonSituations":"Git merge conflicts resolved inside the binary lockfile; LFS/smudge filters rewriting bun.lockb; hand-editing bun.lock YAML; importing a repo with an unusual pnpm-lock.yaml.","solutions":["Restore a known-good lockfile from git: `git checkout -- bun.lockb bun.lock`","Otherwise delete the lockfile(s) and run `bun install` to re-resolve from package.json","When migrating from pnpm and it persists, remove pnpm-lock.yaml and let Bun resolve fresh","Upgrade Bun in case the file was written by a newer format"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await Bun.$`bun install`;\n} catch {\n  await Bun.$`git checkout -- bun.lockb bun.lock`.quiet();\n  await Bun.$`bun install`;\n}","preventionTips":["Keep bun.lockb out of merge tools and LFS filters","Restore lockfiles from git rather than repairing them by hand","Commit lockfiles only from successful installs"],"tags":["lockfile","parsing","migration","corruption"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}