nexu-io/open-design · error · Error

volcengine image fetch ${imgResp.status}

Error message

volcengine image fetch ${imgResp.status}

What it means

Thrown when downloading the image bytes from `entry.url` (the URL delivery path, used when Volcengine returns a URL instead of `b64_json`) fails with `!imgResp.ok`. Usually a transient CDN error or an expired signed link.

Source

Thrown at apps/daemon/src/media/index.ts:1582

  }));
  const text = await resp.text();
  if (!resp.ok) {
    throw new Error(`volcengine image ${resp.status}: ${truncate(text, 240)}`);
  }
  let data: any;
  try {
    data = JSON.parse(text);
  } catch {
    throw new Error(`volcengine image non-JSON: ${truncate(text, 200)}`);
  }
  const entry = data && Array.isArray(data.data) ? data.data[0] : null;
  if (!entry) throw new Error('volcengine image response had no data[0]');
  let bytes;
  if (entry.b64_json) {
    bytes = Buffer.from(entry.b64_json, 'base64');
  } else if (entry.url) {
    const imgResp = await fetch(entry.url, withMediaRequestInit(ctx));
    if (!imgResp.ok) throw new Error(`volcengine image fetch ${imgResp.status}`);
    bytes = Buffer.from(await imgResp.arrayBuffer());
  } else {
    throw new Error('volcengine image response missing b64_json/url');
  }
  return {
    bytes,
    providerNote: `volcengine/${ctx.wireModel} · ${ctx.aspect} · ${bytes.length} bytes`,
    suggestedExt: '.png',
  };
}

// ---------------------------------------------------------------------------
// Provider: xAI Grok Imagine.
//
// Docs: https://docs.x.ai/developers/model-capabilities/{images,video}/generation
//   * Image: POST /v1/images/generations — synchronous, returns
//            {data:[{b64_json|url}]}; we ask for b64_json so the bytes
//            arrive in one round-trip.

View on GitHub (pinned to 5be4028344)

Solutions

  1. Retry the render; the image fetch is idempotent against transient CDN errors.
  2. Ensure the Volcengine image-storage host is reachable from the daemon host.
  3. If persistent, request `b64_json` delivery (already set in the body) to avoid the URL hop.
Defensive patterns

Strategy: retry

Try / catch

// URL-fetch failures are transient — retry the whole render.
try { return await renderVolcengineImage(ctx, credentials); }
catch (err) {
  const msg = err instanceof Error ? err.message : String(err);
  if (/image fetch 5\d{2}/.test(msg)) { return await renderVolcengineImage(ctx, credentials); }
  throw err;
}

Prevention

When it happens

Trigger: `imgResp.ok === false` on `fetch(entry.url)` after the Seedream call returned a `url` field. Causes: object-storage CDN transient 5xx, a signed URL that already expired, or a network/proxy blocking the image host.

Common situations: (1) CDN transient 5xx; (2) network policy blocking the image-storage host; (3) delay between generation and download expiring the link.

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/472e9af6e313f1e5. Report an issue: GitHub.