{"record":{"id":"a7057d5d350ca6a4","repo":"jackwener/OpenCLI","slug":"dblp-returned-404-the-requested-record-may-not-e","errorCode":null,"errorMessage":"dblp returned 404 — the requested record may not exist.","messagePattern":"dblp returned 404 — the requested record may not exist\\.","errorType":"http","errorClass":"EmptyResultError","httpStatus":404,"severity":"warning","filePath":"clis/dblp/utils.js","lineNumber":48,"sourceCode":"async function dblpFetch(url, label, accept) {\n    let res;\n    try {\n        res = await fetch(url, {\n            headers: {\n                accept,\n                'user-agent': 'opencli-dblp/1.0 (+https://github.com/jackwener/opencli)',\n            },\n        });\n    }\n    catch (err) {\n        throw new CommandExecutionError(`${label} request failed: ${err?.message ?? err}`, 'Check that dblp.org is reachable from this network.');\n    }\n    if (!res.ok) {\n        if (res.status === 429) {\n            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.');\n        }\n        if (res.status === 404) {\n            throw new EmptyResultError(label, 'dblp returned 404 — the requested record may not exist.');\n        }\n        throw new CommandExecutionError(`${label} returned HTTP ${res.status}`, 'Inspect the response in a browser at the same URL for more context.');\n    }\n    return res;\n}\n\nexport async function dblpFetchJson(path, label) {\n    const res = await dblpFetch(`${DBLP_ORIGIN}${path}`, label, 'application/json');\n    let body;\n    try {\n        body = await res.json();\n    }\n    catch (err) {\n        throw new CommandExecutionError(`${label} returned malformed JSON: ${err?.message ?? err}`);\n    }\n    const statusCode = String(body?.result?.status?.['@code'] ?? '').trim();\n    if (!statusCode) {\n        throw new CommandExecutionError(","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/dblp/utils.js#L30-L66","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the PID/key exists by opening the equivalent URL on dblp.org in a browser","Re-derive the key/PID via `dblp search '<title>'` or the author's dblp page","Fix typos in the path segments (venue, year, author, slashes)","If dblp.org serves the page in a browser but CLI gets 404, update the CLI (path construction may be wrong)"],"exampleFix":"// before\nopencli dblp paper conf/nips/9999/nope\n// Error: dblp returned 404 — the requested record may not exist.\n// after\nopencli dblp search 'attention is all you need'   # get valid key first\nopencli dblp paper conf/nips/2017/neurips-2017","handlingStrategy":"validation","validationCode":"// Pre-verify the record exists before calling the CLI path.\nconst res = await fetch(`https://dblp.org/rec/${key}.xml`);\nif (res.status === 404) throw new Error(`Key ${key} does not exist on dblp`);","typeGuard":"function looksLikeRecordKey(k) {\n  return typeof k === 'string' && /^[a-z]+\\/[\\w.-]+\\/[\\w.-]+$/.test(k);\n}","tryCatchPattern":"try {\n  rows = await dblpPaper({ key });\n} catch (err) {\n  if (/HTTP 404|404/.test(err.message)) {\n    rows = await dblpSearch({ query: key.split('/').pop() }); // re-derive key\n  } else throw err;\n}","preventionTips":["Derive keys from dblp search results, never from memory","Validate key shape before fetching","Treat stale bibliographies as a source of dead keys — re-verify periodically","Fall back to search-by-title when a key 404s"],"tags":["dblp","http-404","empty-result"],"backgroundTag":"http-404-not-found","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}