jackwener/OpenCLI · error · CommandExecutionError

`${label} request failed: ${err?.message ?? err}`

Error message

`${label} request failed: ${err?.message ?? err}`

What it means

eolFetch wraps the underlying fetch() to endoflife.date; when the request itself throws (network failure), it rethrows as CommandExecutionError with the label and the original error message. This means the API was never reached — DNS, TCP, TLS, or connection-level failure — not an HTTP error response. The hint tells you to verify network reachability of endoflife.date.

Source

Thrown at clis/endoflife/utils.js:48

export function requireBoundedInt(value, defaultValue, maxValue, label = 'limit') {
    const raw = value ?? defaultValue;
    const n = typeof raw === 'number' ? raw : Number(raw);
    if (!Number.isInteger(n) || n <= 0) {
        throw new ArgumentError(`endoflife ${label} must be a positive integer`);
    }
    if (n > maxValue) {
        throw new ArgumentError(`endoflife ${label} must be <= ${maxValue}`);
    }
    return n;
}

export async function eolFetch(url, label) {
    let resp;
    try {
        resp = await fetch(url, { headers: { 'user-agent': UA, accept: 'application/json' } });
    }
    catch (err) {
        throw new CommandExecutionError(
            `${label} request failed: ${err?.message ?? err}`,
            'Check that endoflife.date is reachable from this network.',
        );
    }
    if (resp.status === 404) {
        throw new EmptyResultError(label, `endoflife.date returned 404 for ${url}.`);
    }
    if (resp.status === 429) {
        throw new CommandExecutionError(
            `${label} returned HTTP 429 (rate limited)`,
            'endoflife.date throttles unauthenticated traffic; wait a few seconds and retry.',
        );
    }
    if (!resp.ok) {
        throw new CommandExecutionError(`${label} returned HTTP ${resp.status}`);
    }
    let body;
    try {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify connectivity: curl -I https://endoflife.date/api
  2. Check DNS resolution of endoflife.date (nslookup / dig)
  3. Set HTTPS_PROXY/HTTP_PROXY if behind a corporate proxy
  4. Retry after confirming the network or endoflife.date status

Example fix

// before
$ opencli endoflife cycles nodejs
Error: cycles request failed: getaddrinfo ENOTFOUND endoflife.date
// after
$ export HTTPS_PROXY=http://proxy.corp:8080
$ opencli endoflife cycles nodejs   # succeeds
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight reachability check
const reachable = await fetch('https://endoflife.date/api', { method: 'HEAD' })
  .then(() => true)
  .catch(() => false);
if (!reachable) throw new Error('endoflife.date unreachable; check network/proxy');

Try / catch

try {
  const data = await getCycles('nodejs');
} catch (err) {
  if (/request failed/.test(err.message)) {
    // network-level failure: fall back to cache or retry later
  } else throw err;
}

Prevention

When it happens

Trigger: Any adapter call (e.g. cycles) invoking eolFetch while the machine is offline, DNS for endoflife.date fails, a proxy/firewall blocks the connection, or TLS interception breaks the handshake — fetch() rejects before a Response exists.

Common situations: Working behind a corporate proxy without HTTPS_PROXY configured; VPN or captive portal dropping traffic; DNS misconfiguration; endoflife.date outage or local firewall blocking outbound HTTPS.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/d67554ecf51b54f4. Report an issue: GitHub.