kubernetes/minikube · error · Error

Network response was not ok

Error message

Network response was not ok

What it means

This error is thrown by flake_chart.js after `fetch(url)` completes but `response.ok` is false, meaning the gopogh server answered with an HTTP 4xx/5xx status. The URL is built from the hardcoded basePath ('https://gopogh-server-tts3vkcpgq-uc.a.run.app') plus '/summary', '/env?env=...&tests_in_top=...', or '/test?env=...&test=...' depending on which chart was requested. It is a transport-level success but an application-level failure: the endpoint exists at the HTTP layer yet rejected the request. Note that a DNS failure or CORS block throws a TypeError from fetch instead, so this message specifically indicates the server responded with an error status.

Source

Thrown at hack/jenkins/test-flake-chart/flake_chart.js:788

      await new Promise(resolve => google.charts.setOnLoadCallback(resolve));

      let url;
      const basePath = 'https://gopogh-server-tts3vkcpgq-uc.a.run.app' // Base Server Path. Modify to actual server path if deploying
      if (desiredEnvironment === undefined) {
          // URL for displaySummaryChart
          url = basePath + '/summary'
      } else if (desiredTest === undefined) {
          // URL for displayEnvironmentChart
          url = basePath + '/env' + '?env=' + desiredEnvironment + '&tests_in_top=' + desiredTestNumber;
      } else {
          // URL for displayTestAndEnvironmentChart
          url = basePath + '/test' + '?env=' + desiredEnvironment + '&test=' + desiredTest;
      }

      // Fetch data from the determined URL
      const response = await fetch(url);
      if (!response.ok) {
          throw new Error('Network response was not ok');
      }
      const data = await response.json();
      console.log(data)

      // Call the appropriate chart display function based on the desired condition
      if (desiredTest == undefined && desiredEnvironment === undefined) {
          displaySummaryChart(data)
      } else if (desiredTest === undefined) {
          createTopnDropdown(currentTopn);
          displayEnvironmentChart(data, query);
      } else {
          displayTestAndEnvironmentChart(data, query);
      }
      url = basePath + '/version'

      const verResponse = await fetch(url);
      if (!verResponse.ok) {
          throw new Error('Network response was not ok');

View on GitHub (pinned to a899afc0eb)

Solutions

  1. Open the exact failing URL (e.g. https://gopogh-server-tts3vkcpgq-uc.a.run.app/summary) in a browser or with curl to see the raw status code and body.
  2. If it is 404/503 from Cloud Run, update basePath at flake_chart.js:773 to the current gopogh-server deployment URL.
  3. If it is 404/400 on /env or /test, verify the env= and test= values against the names the server actually stores (check the /summary response) and fix the chart page's query parameters.
  4. Redeploy or upgrade gopogh-server so all three routes (/summary, /env, /test) are served.
  5. Improve the error to include response.status and response.statusText so future hits are diagnosable.

Example fix

// before
const response = await fetch(url);
if (!response.ok) {
    throw new Error('Network response was not ok');
}

// after
const response = await fetch(url);
if (!response.ok) {
    throw new Error(`Request to ${url} failed: ${response.status} ${response.statusText}`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

async function assertEndpointOk(basePath, pathAndQuery) {
  const probe = await fetch(basePath + pathAndQuery, { method: 'HEAD' });
  if (!probe.ok && probe.status !== 405) {
    throw new Error(`Pre-check failed for ${pathAndQuery}: ${probe.status}`);
  }
}
// before the real fetch:
// await assertEndpointOk(basePath, '/summary');

Type guard

function isHttpResponseError(err) {
  return err instanceof Error && /failed: \d{3}/.test(err.message);
}

Try / catch

try {
  const response = await fetch(url);
  if (!response.ok) {
    throw new Error(`Request to ${url} failed: ${response.status} ${response.statusText}`);
  }
  const data = await response.json();
} catch (err) {
  if (err instanceof TypeError) {
    displayError(new Error(`Cannot reach gopogh server at ${basePath} (network/CORS)`));
  } else {
    displayError(err);
  }
}

Prevention

When it happens

Trigger: Opening the flake chart page with no env/test filters (GET {basePath}/summary), with an environment filter (GET {basePath}/env?env=<name>&tests_in_top=<n>), or with both env and test (GET {basePath}/test?env=<name>&test=<test>) and the server returning 404 (unknown env/test name or undeployed Cloud Run service), 400 (invalid tests_in_top value), or 5xx (gopogh-server crash).

Common situations: The hardcoded Cloud Run URL in flake_chart.js:773 is stale or the service was renamed/undeployed; a test or environment name in the query string does not match what the server has (e.g. a job renamed in Jenkins); the gopogh-server version deployed does not implement the /env or /test routes; transient Cloud Run cold-start failures.


AI-assisted analysis of kubernetes/minikube@a899afc0eb (2026-08-15). Data as JSON: /api/errors/1a4bd8f965c4f527. Report an issue: GitHub.