Egonex-AI/Understand-Anything · warning · Error
Freshness request failed
Error message
Freshness request failed
What it means
Thrown by requestFreshnessReport when the HTTP response from the freshness endpoint has a non-ok status. The function fetches the URL with an AbortSignal and no-store cache, then immediately checks response.ok before parsing the body; any 4xx/5xx is fatal and not retried. Callers in startFreshnessRefresh catch it and degrade to an 'unknown/freshness-request-failed' report.
Source
Thrown at understand-anything-plugin/packages/dashboard/src/freshness.ts:173
!("domain" in value.graphs) ||
isGraphFreshnessResult(value.graphs.domain)
);
}
export function shouldRequestFreshness(
demoMode: boolean,
demoFreshnessUrl?: string,
): boolean {
return !demoMode || Boolean(demoFreshnessUrl);
}
export async function requestFreshnessReport(
url: string,
signal: AbortSignal,
fetcher: typeof fetch = fetch,
): Promise<DashboardFreshnessReport> {
const response = await fetcher(url, { signal, cache: "no-store" });
if (!response.ok) throw new Error("Freshness request failed");
const payload: unknown = await response.json();
if (!isDashboardFreshnessReport(payload)) {
throw new Error("Freshness response was malformed");
}
return payload;
}
interface FreshnessRefreshOptions {
target: Pick<EventTarget, "addEventListener" | "removeEventListener">;
load: (signal: AbortSignal) => Promise<DashboardFreshnessReport>;
onResult: (report: DashboardFreshnessReport) => void;
}
function requestFailedReport(): DashboardFreshnessReport {
return {
graphs: {
knowledge: {View on GitHub (pinned to 32944829e7)
Solutions
- Verify the dashboard dev server is running and the freshness URL is correct and reachable.
- Check the access token used for the freshness endpoint is valid and has not expired.
- Inspect server logs for the underlying status code returned by the freshness route.
- Handle the error gracefully — startFreshnessRefresh already maps it to an 'unknown' report, so ensure callers rely on that fallback rather than treating it as fatal.
Example fix
// before
const report = await requestFreshnessReport(url, signal);
// after — tolerate failure and use the degraded report
try { const report = await requestFreshnessReport(url, signal); }
catch { /* fall back to { graphs: { knowledge: { status: 'unknown', reason: 'freshness-request-failed' } } } */ } Defensive patterns
Strategy: fallback
Validate before calling
// pre-check the endpoint reachability before the freshness call
const probe = await fetch(url, { method: 'HEAD' });
if (!probe.ok) { /* skip freshness, use degraded report */ } Try / catch
try { const report = await requestFreshnessReport(url, signal); onResult(report); }
catch (e) { onResult({ graphs: { knowledge: { status: 'unknown', reason: 'freshness-request-failed' } } }); } Prevention
- Rely on startFreshnessRefresh which already degrades to an 'unknown' report on failure.
- Keep the dashboard dev server version aligned with the client so the freshness route exists.
- Validate the access token used by the freshness endpoint.
When it happens
Trigger: The dashboard dev server's freshness endpoint returns 404 (route removed/misconfigured), 401/403 (access token invalid), 500 (server-side git probe failure), or the endpoint is unreachable and a non-ok response is returned by a proxy.
Common situations: Dashboard dev server running a version that lacks the freshness route; access token expired or revoked; reverse proxy returning an error page; the freshness endpoint disabled in a deployment.
Related errors
- Figma API ${path} failed: ${res.status} ${res.statusText}
- Freshness response was malformed
- HTTP ${res.status}
- Source unavailable
AI-assisted analysis of Egonex-AI/Understand-Anything@32944829e7 (2026-08-12).
Data as JSON: /api/errors/de64f09a1eae4157.
Report an issue: GitHub.