jackwener/OpenCLI · error · CommandExecutionError

Network failure fetching ${label}: ${e?.message ?? e}

Error message

Network failure fetching ${label}: ${e?.message ?? e}

What it means

openreviewFetch wraps all HTTP access to the OpenReview API and converts a fetch rejection (DNS failure, connection refused, TLS error, timeout) into a CommandExecutionError with a remediation hint. This guarantees network problems are never mistaken for empty results. The message includes the underlying error text for diagnosis.

Source

Thrown at clis/openreview/utils.js:80

    const id = String(value ?? '').trim();
    if (!id) {
        throw new ArgumentError(`openreview ${label} is required`);
    }
    if (!PROFILE_ID_PATTERN.test(id)) {
        throw new ArgumentError(`openreview ${label} "${value}" is not a valid profile id (expected "~First_Last1" or similar; find it on the author's openreview.net profile URL)`);
    }
    return id;
}

/** Wrap fetch + json with typed errors so failures never look like empty results. */
export async function openreviewFetch(path, label) {
    const url = `${OPENREVIEW_API}${path}`;
    let resp;
    try {
        resp = await fetch(url);
    }
    catch (e) {
        throw new CommandExecutionError(`Network failure fetching ${label}: ${e?.message ?? e}`, 'Check your network connection and try again.');
    }
    if (resp.status === 404) {
        return null;
    }
    if (!resp.ok) {
        let body = '';
        try { body = (await resp.text()).slice(0, 200); } catch {}
        throw new CommandExecutionError(`OpenReview API HTTP ${resp.status} for ${label}${body ? ` (${body})` : ''}`, 'The OpenReview API may be down or rate-limiting.');
    }
    let json;
    try {
        json = await resp.json();
    }
    catch (e) {
        throw new CommandExecutionError(`Malformed JSON from OpenReview for ${label}: ${e?.message ?? e}`, 'Try again or report this as an OpenReview API bug.');
    }
    const envelopeErrors = Array.isArray(json?.errors) ? json.errors.filter(Boolean) : [];
    const envelopeError = typeof json?.error === 'string' ? json.error.trim() : '';

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify network connectivity (curl https://api2.openreview.net) and retry.
  2. Check proxy/VPN settings; set HTTPS_PROXY or NODE_EXTRA_CA_CERTS if behind a corporate proxy.
  3. Check OpenReview status pages for an outage.

Example fix

// before
await openreviewFetch(path, label) // throws on any network blip
// after
for (let i = 0; i < 3; i++) {
  try { return await openreviewFetch(path, label); }
  catch (e) { if (i === 2 || !/Network failure/.test(e.message)) throw e; await sleep(2 ** i * 500); }
}
Defensive patterns

Strategy: retry

Validate before calling

import { execSync } from 'node:child_process';
try { execSync('curl -sf -m 5 https://api2.openreview.net', { stdio: 'ignore' }); } catch { console.error('OpenReview API unreachable'); process.exit(1); }

Try / catch

try { return await openreviewFetch(path, label); }
catch (e) {
  if (e instanceof CommandExecutionError && /Network failure/.test(e.message)) {
    await new Promise(r => setTimeout(r, 2000));
    return openreviewFetch(path, label); // one retry
  }
  throw e;
}

Prevention

When it happens

Trigger: fetch() rejects while requesting ${OPENREVIEW_API}${path}: no internet, DNS outage, proxy/firewall blocking the API host, TLS interception, or the fetch timing out.

Common situations: Laptop offline or on captive-portal Wi-Fi; corporate proxy without NODE_EXTRA_CA_CERTS; VPN blocking the API host; DNS misconfiguration; OpenReview API temporarily unreachable.

Related errors


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