paperclipai/paperclip · error

Failed to load health (${res.status})

Error message

Failed to load health (${res.status})

What it means

The UI health API got a non-OK response from GET /api/health. The thrown error prefers the server's JSON error payload; this fallback text (with HTTP status) is used when the body has no error field or is not JSON.

Source

Thrown at ui/src/api/health.ts:54

  serverInfo?: ServerInfoSnapshot;
  devServer?: DevServerHealthStatus;
  cloud?: CloudInstanceHealthStatus;
  /**
   * Settings surfaces hidden by the hosting operator (keys from the shared
   * settings-visibility registry). Absent when nothing is hidden.
   */
  hiddenSettings?: string[];
};

export const healthApi = {
  get: async (): Promise<HealthStatus> => {
    const res = await fetch("/api/health", {
      credentials: "include",
      headers: { Accept: "application/json" },
    });
    if (!res.ok) {
      const payload = await res.json().catch(() => null) as { error?: string } | null;
      throw new Error(payload?.error ?? `Failed to load health (${res.status})`);
    }
    return res.json();
  },
  requestDevServerRestart: async (): Promise<void> => {
    const res = await fetch("/api/health/dev-server/restart", {
      method: "POST",
      credentials: "include",
      headers: { Accept: "application/json" },
    });
    if (!res.ok) {
      const payload = await res.json().catch(() => null) as { error?: string } | null;
      throw new Error(payload?.error ?? `Failed to request restart (${res.status})`);
    }
  },
};

View on GitHub (pinned to a7e689b3c3)

Solutions

  1. Confirm the API server is running and reachable, then retry the health load.
  2. Re-authenticate if the status indicates an auth failure.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at ui/src/api/health.ts:49 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18). Data as JSON: /api/errors/bf3a8d47bc7cd604. Report an issue: GitHub.