jackwener/OpenCLI · error · EmptyResultError
Flathub returned 404 for ${url}.
Error message
Flathub returned 404 for ${url}. What it means
flathubFetch maps HTTP 404 from flathub.org to EmptyResultError with the message 'Flathub returned 404 for <url>'. It means the requested resource (typically GET /appstream/<appId>) does not exist on Flathub — almost always an appId that is not in the registry.
Source
Thrown at clis/flathub/utils.js:63
}
export async function flathubFetch(url, label, init) {
let resp;
try {
resp = await fetch(url, {
method: init?.method ?? 'GET',
headers: { 'user-agent': UA, accept: 'application/json', ...(init?.headers ?? {}) },
body: init?.body,
});
}
catch (err) {
throw new CommandExecutionError(
`${label} request failed: ${err?.message ?? err}`,
'Check that flathub.org is reachable from this network.',
);
}
if (resp.status === 404) {
throw new EmptyResultError(label, `Flathub returned 404 for ${url}.`);
}
if (resp.status === 429) {
throw new CommandExecutionError(`${label} returned HTTP 429 (rate limited)`);
}
if (!resp.ok) {
throw new CommandExecutionError(`${label} returned HTTP ${resp.status}`);
}
let body;
try {
body = await resp.json();
}
catch (err) {
throw new CommandExecutionError(`${label} returned malformed JSON: ${err?.message ?? err}`);
}
return body;
}
export function joinList(value, max = 10) {View on GitHub (pinned to 49907e53dc)
Solutions
- Run `flathub search <name>` to get the current correct appId and retry
- Verify the exact ID spelling segment by segment (org.vendor.AppName)
- Check the app page at https://flathub.org/apps/<appId> to confirm it exists
- Handle EmptyResultError in your code if IDs come from user input, and surface a 'not found' message
Example fix
// before
await appInfo('org.gnome.calculator'); // wrong case
// after
await appInfo('org.gnome.Calculator'); Defensive patterns
Strategy: try-catch
Validate before calling
const APP_ID_RE = /^[A-Za-z][A-Za-z0-9_-]*(?:\.[A-Za-z0-9_][A-Za-z0-9_-]*){1,}$/;
if (!APP_ID_RE.test((appId ?? '').trim())) throw new Error('malformed appId — resolve it via flathub search first'); Type guard
null
Try / catch
try {
const info = await appInfo(appId);
} catch (err) {
if (err instanceof EmptyResultError) {
console.log(`App "${appId}" not found on Flathub — run flathub search to get the correct ID`);
} else throw err;
} Prevention
- Resolve appIds dynamically via `flathub search` instead of hard-coding them
- Handle EmptyResultError explicitly when IDs come from user input or external data
- Re-verify hard-coded IDs periodically — apps get renamed or removed
- Check https://flathub.org/apps/<appId> in a browser when a 404 persists
When it happens
Trigger: Calling an app-detail adapter with a well-formed but nonexistent appId (e.g. org.mozilla.firefoxx); an app that was removed/renamed on Flathub; a typo in one ID segment; requesting an app hosted only outside Flathub.
Common situations: Hard-coded appIds in scripts that became stale after a rename; IDs from third-party docs; searching found the app elsewhere but the Flathub ID differs; clipboard truncation dropping a segment.
Related errors
- Chess.com returned 404 for ${url}
- crates.io returned 404 for ${url}.
- hf paper
- Homebrew API returned 404 for ${url}.
- User not found: ' + username
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2a7d7225744a0e03.
Report an issue: GitHub.