oven-sh/bun · error · Error

picsum ${p.id}: ${res.status}

Error message

picsum ${p.id}: ${res.status}

What it means

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).

Source

Thrown at bench/image/visual-compare.mjs:46

  { id: 1025, name: "pug", note: "fur detail, shallow DOF" },
  { id: 1040, name: "castle", note: "hard architectural edges" },
  { id: 1043, name: "leaves", note: "high-frequency green" },
  { id: 1056, name: "road", note: "vanishing-point lines" },
  { id: 1069, name: "jellyfish", note: "soft gradients on black" },
  { id: 1074, name: "lion", note: "fur + bokeh" },
  { id: 1080, name: "strawberries", note: "saturated red, seed detail" },
  { id: 110, name: "field", note: "sky gradient banding test" },
  { id: 237, name: "puppy", note: "dark fur, high contrast" },
  { id: 433, name: "bear", note: "fur, snow highlights" },
  { id: 660, name: "city-night", note: "point lights, noise" },
];

async function fetchPic(p) {
  const path = CACHE + `pic_${p.id}.jpg`;
  if (existsSync(path)) return readFileSync(path);
  process.stderr.write(`  fetch ${p.name} (#${p.id})… `);
  const res = await fetch(`https://picsum.photos/id/${p.id}/2400/1600`, { redirect: "follow" });
  if (!res.ok) throw new Error(`picsum ${p.id}: ${res.status}`);
  const buf = Buffer.from(await res.arrayBuffer());
  writeFileSync(path, buf);
  process.stderr.write(`${(buf.length / 1024).toFixed(0)} KB\n`);
  return buf;
}

// ─── synthetic torture patterns (kept; they're where filters visibly differ) ─
function crc32(buf) {
  let c = ~0 >>> 0;
  for (let i = 0; i < buf.length; i++) {
    c ^= buf[i];
    for (let k = 0; k < 8; k++) c = (c >>> 1) ^ (0xedb88320 & -(c & 1));
  }
  return ~c >>> 0;
}
function pngChunk(type, data) {
  const out = new Uint8Array(12 + data.length);
  const dv = new DataView(out.buffer);

View on GitHub (pinned to 8c5296ac45)

Solutions

  1. Restore a known-good lockfile from git: `git checkout -- bun.lockb bun.lock`
  2. Otherwise delete the lockfile(s) and run `bun install` to re-resolve from package.json
  3. When migrating from pnpm and it persists, remove pnpm-lock.yaml and let Bun resolve fresh
  4. Upgrade Bun in case the file was written by a newer format
Defensive patterns

Strategy: fallback

Try / catch

try {
  await Bun.$`bun install`;
} catch {
  await Bun.$`git checkout -- bun.lockb bun.lock`.quiet();
  await Bun.$`bun install`;
}

Prevention

When it happens

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

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

Related errors


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