dotnet/orleans · warning · Error

HTTP error! status: ${response.status}

Error message

HTTP error! status: ${response.status}

What it means

This is a browser-side JavaScript Error thrown inside the fetchData() poller in the ActivationRebalancing frontend when the HTTP response to GET /api/stats/silos is not 'ok' (any non-2xx status). fetch() does not reject on HTTP error codes by design, so the code explicitly checks response.ok and throws to route failures into the .catch() handler. The catch only console.errors, so the chart silently stops updating.

Source

Thrown at playground/ActivationRebalancing/ActivationRebalancing.Frontend/wwwroot/index.html:553

        // Update line generators with new scale
        const updatedLineGenerators = colors.map(() => d3.line()
          .x((d, i) => xScale(i))
          .y(d => yScale(d)));

        linePaths.each(function (d, i) {
          d3.select(this)
            .datum(activationsHistory[i])
            .attr("d", updatedLineGenerators[i]);
        });
      };
    }

    function fetchData() {
      fetch('/api/stats/silos')
        .then(response => {
          if (!response.ok) {
            throw new Error(`HTTP error! status: ${response.status}`);
          }
          return response.json();
        })
        .then(newData => {
          console.log('Fetched Data:', newData);
          updateChart(newData);
        })
        .catch(error => {
          console.error('Error fetching grain stats:', error);
        });
    }

    setInterval(fetchData, 500);
    fetchData();

    // Handle window resize for responsiveness
    let resizeTimeout;
    window.addEventListener('resize', () => {

View on GitHub (pinned to fca799fa70)

Solutions

  1. Open the browser devtools Network tab and inspect the status code + response body of /api/stats/silos to find the real backend error.
  2. If status is 500, check the backend logs — most likely the StatsController hit the 'more than 6 silos' guard; fix the cluster size.
  3. Confirm the frontend is still connected to its Orleans client and that the controller route is reachable (no reverse-proxy path mismatch).

Example fix

// before
if (!response.ok) {
  throw new Error(`HTTP error! status: ${response.status}`);
}

// after (surface the response body for diagnosis)
if (!response.ok) {
  const body = await response.text();
  throw new Error(`HTTP error! status: ${response.status}: ${body}`);
}
Defensive patterns

Strategy: try-catch

Try / catch

async function fetchData() {
  try {
    const response = await fetch('/api/stats/silos');
    if (!response.ok) throw new Error(`HTTP ${response.status}`);
    updateChart(await response.json());
  } catch (error) {
    console.error('Stats fetch failed; retrying next interval', error);
  }
}

Prevention

When it happens

Trigger: The periodic fetch('/api/stats/silos') receives a 4xx/5xx — most commonly 500 because the StatsController threw the 'more than 6 silos' NotSupportedException (error 0), or the controller is unreachable / silo host is down.

Common situations: Backend controller threw an exception (see error 0). The Orleans cluster disconnected, the frontend process restarted, or a proxy/gateway returned an error page. CORS or routing misconfiguration returning 404.

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/783052205a3bf429. Report an issue: GitHub.