bytedance/deer-flow · error

HTTP ${response.status}: ${text}

Error message

HTTP ${response.status}: ${text}

What it means

httpPost in the chart-visualization skill's generate.js wraps fetch(POST JSON) and throws `HTTP <status>: <body>` when the remote chart service (getVisRequestServer()) answers non-ok. The body text is inlined so the caller sees the service's own error output.

Source

Thrown at skills/public/chart-visualization/scripts/generate.js:56

  );
}

function getServiceIdentifier() {
  return process.env.SERVICE_ID;
}

async function httpPost(url, payload) {
  const response = await fetch(url, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify(payload),
  });

  if (!response.ok) {
    const text = await response.text();
    throw new Error(`HTTP ${response.status}: ${text}`);
  }

  return response.json();
}

async function generateChartUrl(chartType, options) {
  const url = getVisRequestServer();
  const payload = {
    type: chartType,
    source: "chart-visualization-creator",
    ...options,
  };

  const data = await httpPost(url, payload);

  if (!data.success) {
    throw new Error(data.errorMessage || "Unknown error");
  }

View on GitHub (pinned to 1dd6ba1acb)

Solutions

  1. Read the status and body in the thrown message: 401/403 means credentials/quota, 404/502 usually a wrong VIS_REQUEST_SERVER URL, 4xx with JSON a payload-contract issue.
  2. Verify getVisRequestServer() resolves to the intended service (check the env/config it reads) and curl it with a minimal payload.
  3. If the service API changed, update the payload builders (generateChartUrl / generateMap) to the new contract.
  4. For quota errors, add backoff/retry or switch to a self-hosted instance.

Example fix

// before: throws raw HTTP text (often huge HTML)
throw new Error(`HTTP ${response.status}: ${text}`);

// after: truncate and name the endpoint
throw new Error(`Chart service ${url} failed (${response.status}): ${text.slice(0, 300)}`);
Defensive patterns

Strategy: try-catch

Validate before calling

// Pre-flight the endpoint cheaply before posting the real payload:
// const probe = await fetch(getVisRequestServer(), { method: 'OPTIONS' });
// if (!probe.ok && probe.status !== 404) fail fast with a clear message.

Try / catch

try { const url = await generateChartUrl(type, opts); } catch (e) { console.error('chart service failure:', e.message); throw new Error(`Chart generation unavailable (${extractStatus(e.message)}); check VIS_REQUEST_SERVER`); }

Prevention

When it happens

Trigger: The configured vis-request server returns 4xx (bad payload for the chart type, missing serviceId for maps) or 5xx (service down). Also DNS/connect failures surface as fetch rejections, but any HTTP-level failure produces this formatted error.

Common situations: VIS_REQUEST_SERVER env var unset or pointing at a wrong/unreachable deployment (leading to a proxy 404/502 HTML body inlined into the message), the chart service API changing its contract, or a quota/rate-limit response from the hosted chart service.

Related errors


AI-assisted analysis of bytedance/deer-flow@1dd6ba1acb (2026-08-14). Data as JSON: /api/errors/ecab2e186470aeb9. Report an issue: GitHub.