jackwener/OpenCLI · warning · EmptyResultError

dblp returned 404 — the requested record may not exist.

Error message

dblp returned 404 — the requested record may not exist.

What it means

EmptyResultError thrown by dblpFetch when dblp.org responds with HTTP 404 Not Found. The library maps 404 to an empty-result error because it usually means the requested record/PID/key does not exist rather than a transport failure.

Source

Thrown at clis/dblp/utils.js:48

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();
    }
    catch (err) {
        throw new CommandExecutionError(`${label} returned malformed JSON: ${err?.message ?? err}`);
    }
    const statusCode = String(body?.result?.status?.['@code'] ?? '').trim();
    if (!statusCode) {
        throw new CommandExecutionError(

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Verify the PID/key exists by opening the equivalent URL on dblp.org in a browser
  2. Re-derive the key/PID via `dblp search '<title>'` or the author's dblp page
  3. Fix typos in the path segments (venue, year, author, slashes)
  4. If dblp.org serves the page in a browser but CLI gets 404, update the CLI (path construction may be wrong)

Example fix

// before
opencli dblp paper conf/nips/9999/nope
// Error: dblp returned 404 — the requested record may not exist.
// after
opencli dblp search 'attention is all you need'   # get valid key first
opencli dblp paper conf/nips/2017/neurips-2017
Defensive patterns

Strategy: validation

Validate before calling

// Pre-verify the record exists before calling the CLI path.
const res = await fetch(`https://dblp.org/rec/${key}.xml`);
if (res.status === 404) throw new Error(`Key ${key} does not exist on dblp`);

Type guard

function looksLikeRecordKey(k) {
  return typeof k === 'string' && /^[a-z]+\/[\w.-]+\/[\w.-]+$/.test(k);
}

Try / catch

try {
  rows = await dblpPaper({ key });
} catch (err) {
  if (/HTTP 404|404/.test(err.message)) {
    rows = await dblpSearch({ query: key.split('/').pop() }); // re-derive key
  } else throw err;
}

Prevention

When it happens

Trigger: Any dblp subcommand whose constructed path (e.g. /pid/<pid>.xml, /rec/<key>.xml) returns 404 — a nonexistent PID, a deleted or wrong record key, or a malformed path segment after validation.

Common situations: Typo in PID or record key; record removed from dblp; PID belonging to a different dblp entity type; stale key copied from an old bibliography.

Related errors


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