cockroachdb/cockroach · error · Error

Error response from server: ${resp.status}

Error message

Error response from server: ${resp.status}

What it means

At DB Console bootstrap, fetchDataFromServer GETs the relative 'uiconfig' endpoint to obtain server-provided configuration; any HTTP status >= 400 throws 'Error response from server: <status>'. This is the static-bootstrap config path (served by the node's HTTP endpoint), distinct from the admin API, and the thrown number is the raw HTTP status.

Source

Thrown at pkg/ui/workspaces/db-console/src/util/dataFromServer.ts:43

// Tell TypeScript about `window.dataFromServer`, which is set in a script
// tag in index.html, the contents of which are generated in a Go template
// server-side.
declare global {
  interface Window {
    dataFromServer: DataFromServer;
  }
}

export function fetchDataFromServer(): Promise<DataFromServer> {
  return fetch("uiconfig", {
    method: "GET",
    headers: {
      Accept: "application/json",
      "Content-Type": "application/json",
    },
  }).then(resp => {
    if (resp.status >= 400) {
      throw new Error(`Error response from server: ${resp.status}`);
    }
    return resp.json();
  });
}

export function getDataFromServer(): DataFromServer {
  return (
    window.dataFromServer ||
    ({
      FeatureFlags: {},
    } as DataFromServer)
  );
}

export function setDataFromServer(d: DataFromServer) {
  window.dataFromServer = d;
}

View on GitHub (pinned to 8812064a01)

Solutions

  1. Open /uiconfig directly in the browser to see the real status and body
  2. Fix the proxy so /uiconfig (and other console paths) reach the node's HTTP endpoint unmodified
  3. Hard-refresh / clear cache after upgrading nodes to drop a stale bundle
  4. Verify the node's HTTP settings and that you are hitting a node that serves the DB Console
Defensive patterns

Strategy: fallback

Validate before calling

// Probe the endpoint before bootstrapping the app
const probe = await fetch('uiconfig', { method: 'HEAD' });
if (!probe.ok) {
  showProxyErrorBanner(probe.status);
}

Try / catch

import { fetchDataFromServer, getDataFromServer } from 'src/util/dataFromServer';
try {
  dataFromServer = await fetchDataFromServer();
} catch (e) {
  // Fall back to the server-injected window global when present
  dataFromServer = getDataFromServer();
  if (!dataFromServer?.LoginURL) {
    throw e; // no fallback available
  }
}

Prevention

When it happens

Trigger: The request for /uiconfig returning 4xx/5xx: a reverse proxy rewriting or stripping the path, an auth layer in front of the console rejecting the request, a mis-routed load balancer sending the request to a non-console service, or a node not serving the console.

Common situations: Accessing the console through a proxy whose location block doesn't pass /uiconfig; OAuth/SSO front-ends intercepting static paths; stale HTML bundle after node upgrade requesting an endpoint removed/renamed; accessing a node with a different --http-addr setup.

Related errors


AI-assisted analysis of cockroachdb/cockroach@8812064a01 (2026-08-15). Data as JSON: /api/errors/2682d37ea53bb525. Report an issue: GitHub.