jackwener/OpenCLI · error · CommandExecutionError

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

Error message

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

What it means

CommandExecutionError thrown by dblpFetch when the underlying HTTP request to dblp.org itself fails (fetch rejects) — DNS failure, connection refused/reset, TLS error, timeout. The error message wraps the original err.message with the request label for context.

Source

Thrown at clis/dblp/utils.js:41

 */
const KEY_PATTERN = /^[a-z]+(?:\/[A-Za-z0-9_.-]+)+$/;

/**
 * Wraps `fetch` with typed errors. We always set a UA per dblp's
 * polite-fetch guidance (https://dblp.org/faq/How+to+use+the+dblp+search+API.html).
 */
async function dblpFetch(url, label, accept) {
    let res;
    try {
        res = await fetch(url, {
            headers: {
                accept,
                'user-agent': 'opencli-dblp/1.0 (+https://github.com/jackwener/opencli)',
            },
        });
    }
    catch (err) {
        throw new CommandExecutionError(`${label} request failed: ${err?.message ?? err}`, 'Check that dblp.org is reachable from this network.');
    }
    if (!res.ok) {
        if (res.status === 429) {
            throw new CommandExecutionError(`${label} returned HTTP 429 (rate limited)`, 'dblp throttles clients that fetch too aggressively. Wait a few seconds and retry, or lower --limit.');
        }
        if (res.status === 404) {
            throw new EmptyResultError(label, 'dblp returned 404 — the requested record may not exist.');
        }
        throw new CommandExecutionError(`${label} returned HTTP ${res.status}`, 'Inspect the response in a browser at the same URL for more context.');
    }
    return res;
}

export async function dblpFetchJson(path, label) {
    const res = await dblpFetch(`${DBLP_ORIGIN}${path}`, label, 'application/json');
    let body;
    try {
        body = await res.json();

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check general internet connectivity (e.g. curl https://dblp.org in a terminal)
  2. Check the wrapped err.message in the error for the root cause (ENOTFOUND, ECONNREFUSED, timeout)
  3. Configure proxy env vars (HTTPS_PROXY) if behind a corporate proxy
  4. Retry later if dblp.org is down (check status/downdetector)
  5. If Node's fetch has TLS issues, verify CA/certificate setup

Example fix

// before
opencli dblp search 'transformers'   # offline
// Error: dblp search request failed: fetch failed
// after
# connect to network / set proxy, then
export HTTPS_PROXY=http://proxy.corp:8080
opencli dblp search 'transformers'
Defensive patterns

Strategy: retry

Validate before calling

// Optionally pre-check reachability before the real call.
const probe = await fetch('https://dblp.org', { method: 'HEAD' }).catch(() => null);
if (!probe) throw new Error('dblp.org unreachable — check network/proxy');

Try / catch

try {
  rows = await dblpSearch({ query });
} catch (err) {
  if (/request failed/.test(err.message)) {
    await sleep(1000);
    rows = await dblpSearch({ query }); // retry once after transient network issue
  } else throw err;
}

Prevention

When it happens

Trigger: Any dblp subcommand (author, paper, search) while the network request throws: no internet, DNS failure, firewall/proxy blocking dblp.org, TLS interception, or dblp.org outage.

Common situations: Working offline; corporate proxy blocking dblp.org; VPN or DNS misconfiguration; dblp.org downtime; IPv6 connectivity issues in the runtime.

Related errors


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