jackwener/OpenCLI · error · CommandExecutionError
coingecko categories request failed: ${err?.message ?? err}
Error message
coingecko categories request failed: ${err?.message ?? err} What it means
The fetch to https://api.coingecko.com/api/v3/coins/categories threw (network-level failure), and the CLI wraps it in a CommandExecutionError including the underlying error message. This happens before any HTTP status is available.
Source
Thrown at clis/coingecko/categories.js:44
throw new ArgumentError(
`coingecko sort "${args.sort}" is not supported`,
`Supported sorts: ${ORDER_OPTIONS.join(', ')}`,
);
}
const limit = Number(args.limit ?? 20);
if (!Number.isInteger(limit) || limit <= 0) {
throw new ArgumentError('coingecko limit must be a positive integer');
}
if (limit > 100) {
throw new ArgumentError('coingecko limit must be <= 100');
}
const url = `https://api.coingecko.com/api/v3/coins/categories?order=${encodeURIComponent(sort)}`;
let resp;
try {
resp = await fetch(url, { headers: { 'User-Agent': 'Mozilla/5.0' } });
}
catch (err) {
throw new CommandExecutionError(`coingecko categories request failed: ${err?.message ?? err}`);
}
if (resp.status === 429) {
throw new CommandExecutionError(
'coingecko returned HTTP 429 (rate limited)',
'Free tier allows ~30 calls/min. Wait and retry.',
);
}
if (!resp.ok) {
throw new CommandExecutionError(`coingecko categories returned HTTP ${resp.status}`);
}
let data;
try {
data = await resp.json();
}
catch (err) {
throw new CommandExecutionError(`coingecko categories returned malformed JSON: ${err?.message ?? err}`);
}
if (!Array.isArray(data) || !data.length) {View on GitHub (pinned to 49907e53dc)
Solutions
- Check network connectivity and retry the command
- Verify DNS/proxy settings (HTTPS_PROXY etc.) allow api.coingecko.com
- Retry later — the error message contains the underlying cause to diagnose further
Defensive patterns
Strategy: retry
Validate before calling
// preflight connectivity
try {
await fetch('https://api.coingecko.com/api/v3/ping', { headers: { 'User-Agent': 'Mozilla/5.0' } });
} catch (e) {
throw new Error('No network access to api.coingecko.com: ' + e.message);
} Type guard
function isNetworkFailure(err) {
return err instanceof CommandExecutionError && /fetch failed|ENOTFOUND|ECONNREFUSED|ETIMEDOUT|ECONNRESET/i.test(err.message);
} Try / catch
try {
await runCategories(args);
} catch (err) {
if (isNetworkFailure(err)) {
await sleep(2000);
await runCategories(args); // retry once
} else throw err;
} Prevention
- Verify proxy env vars (HTTPS_PROXY/NO_PROXY) are correct in CI
- Add timeout + retry with backoff around CLI invocations
- Monitor connectivity to api.coingecko.com before batch runs
When it happens
Trigger: DNS failure, no network connection, TLS errors, connection refused/timeouts, or a proxy blocking api.coingecko.com from clis/coingecko/categories.js.
Common situations: Running the CLI behind a corporate proxy; offline or flaky network; firewall/VPN blocking CoinGecko; Node runtime without network access (sandboxed CI).
Related errors
- coingecko trending request failed: ${error?.message || error
- DuckDuckGo suggest request failed: ${err instanceof Error ?
- archive search request failed: ${error?.message || error}
- archive search returned malformed JSON: ${error?.message ||
- coingecko sort "${args.sort}" is not supported
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e2fd5ed0cb99cbd9.
Report an issue: GitHub.