BloopAI/vibe-kanban · error · Error

Host returned HTTP ${response.status}

Error message

Host returned HTTP ${response.status}

What it means

This error is thrown by the useRelayWorkspaceHostHealth React Query hook when the polling health-check request to the local host's /api/info endpoint returns a non-OK HTTP status. The hook uses makeLocalApiRequest with cache:'no-store' to verify that the local (relay) workspace host is reachable and healthy; any non-2xx response (404, 500, 502, 503, etc.) is converted into this thrown Error so React Query marks the query as failed. It is the library's way of surfacing 'the local host is up enough to answer, but the info endpoint is failing'.

Source

Thrown at packages/remote-web/src/shared/hooks/useRelayWorkspaceHostHealth.ts:33

  return null;
}

export function useRelayWorkspaceHostHealth(
  hostId: string | null,
): UseRelayWorkspaceHostHealthResult {
  const hostHealthQuery = useQuery({
    queryKey: ["remote-workspaces-host-health", hostId],
    enabled: !!hostId,
    retry: false,
    staleTime: 5_000,
    refetchInterval: 15_000,
    queryFn: async (): Promise<true> => {
      const response = await makeLocalApiRequest("/api/info", {
        cache: "no-store",
      });

      if (!response.ok) {
        throw new Error(`Host returned HTTP ${response.status}`);
      }

      return true;
    },
  });

  const isHostUnavailable =
    hostHealthQuery.isError || hostHealthQuery.isRefetchError;

  return {
    isChecking: hostHealthQuery.isPending,
    isError: isHostUnavailable,
    errorMessage: isHostUnavailable
      ? getErrorMessage(hostHealthQuery.error)
      : null,
  };
}

View on GitHub (pinned to 4deb7eca8f)

Solutions

  1. Check that the local host backend process is running and listening on the expected port (restart it if needed).
  2. Open the /api/info URL directly in a browser or curl and note the returned HTTP status to identify 404 vs 5xx vs 401.
  3. Verify the local host version matches the remote web version so the /api/info route exists (upgrade the CLI/local daemon).
  4. If the status is 401/403, check any auth/token configuration between the browser and the local host.
  5. Fix dev proxy configuration (VITE_API_BASE_URL / dev server proxy) so /api reaches the local backend.
  6. Retry later or re-run the health check — React Query will refetch and clear the error once the host responds 2xx.

Example fix

// before: host unreachable/degraded, version mismatch -> 404 from /api/info
// old local daemon serving stale routes
$ npx old-cli serve

// after: update and restart the local host so /api/info returns 200
$ npx latest-cli serve
// hook then reports host healthy
Defensive patterns

Strategy: retry

Validate before calling

// before polling health, check reachability yourself
async function isHostInfoReachable(): Promise<boolean> {
  const res = await makeLocalApiRequest('/api/info', { cache: 'no-store' });
  return res.ok;
}

Type guard

function isHostHealthy(result: unknown): result is true {
  return result === true;
}

Try / catch

try {
  const healthy = await queryClient.fetchQuery({ queryKey: ['hostHealth'], queryFn });
  console.log('host healthy:', healthy);
} catch (e) {
  const status = (e as Error).message.match(/HTTP (\d+)/)?.[1];
  console.warn(`host unhealthy, status=${status ?? 'unknown'}; will retry on next refetch`);
}

Prevention

When it happens

Trigger: The queryFn in useRelayWorkspaceHostHealth calls makeLocalApiRequest('/api/info', {cache:'no-store'}) and the response has response.ok === false — i.e. the local host HTTP server responded with a non-2xx status. This happens when the local backend process is starting up or crashing, the local backend port serves a proxy that returns 502/503, the /api/info route is missing (404) due to a version mismatch between remote-web and the local host, or a reverse proxy/auth layer rejects the request (401/403).

Common situations: Developer's local daemon is not running or crashed so the port is served by something else; local backend and remote server versions are out of sync so /api/info 404s; a dev proxy misroutes /api to the wrong port; local host is behind a firewall/proxy returning 502 Bad Gateway; machine going to sleep mid-session and the host coming back degraded.

Related errors


AI-assisted analysis of BloopAI/vibe-kanban@4deb7eca8f (2026-08-29). Data as JSON: /api/errors/c5cd920fd4d57c6b. Report an issue: GitHub.