jackwener/OpenCLI · error · CommandExecutionError

dblp author search for "${name}" returned a hit without a PI

Error message

dblp author search for "${name}" returned a hit without a PID URL

What it means

CommandExecutionError thrown when dblp's author search returns at least one hit, but the top hit's info contains no PID URL that extractPidFromAuthorHit can parse. The library treats this as an unexpected response-shape change rather than empty data.

Source

Thrown at clis/dblp/author.js:102

        }
        else {
            const name = requireQuery(args.author, 'author');
            const json = await dblpFetchJson(
                `/search/author/api?q=${encodeURIComponent(name)}&format=json&h=20`,
                'dblp author search',
            );
            const raw = json?.result?.hits?.hit;
            const hits = Array.isArray(raw) ? raw : (raw ? [raw] : []);
            if (!hits.length) {
                throw new EmptyResultError(
                    'dblp author',
                    `No dblp author matched "${name}". Try a different spelling, or pass --pid to bypass author search.`,
                );
            }
            const top = pickTopAuthor(hits);
            pid = extractPidFromAuthorHit(top);
            if (!pid) {
                throw new CommandExecutionError(
                    `dblp author search for "${name}" returned a hit without a PID URL`,
                    'dblp may have changed its author-search response shape; retry or pass --pid manually.',
                );
            }
            resolvedName = decodeXmlEntities(String(top?.info?.author ?? '')).trim();
        }
        const xml = await dblpFetchXml(`/pid/${pid}.xml`, `dblp pid ${pid}`);
        const records = splitRecords(xml);
        if (!records.length) {
            throw new EmptyResultError(
                'dblp author',
                `dblp PID ${pid}${resolvedName ? ` (${resolvedName})` : ''} has no publications.`,
            );
        }
        return records.slice(0, limit).map((recordXml, i) => {
            const row = recordXmlToRow(`<root>${recordXml}</root>`);
            return {
                rank: i + 1,

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Retry the search — could be a transient malformed response
  2. Run the same search URL (https://dblp.org/search/author/api?q=<name>&format=json) in a browser to inspect the shape
  3. Pass --pid directly with the author's PID to skip author search
  4. Update the CLI in case a newer version handles the new response shape

Example fix

// before
opencli dblp author --name 'Yoshua Bengio'
// Error: dblp author search for "Yoshua Bengio" returned a hit without a PID URL
// after
opencli dblp author --pid 97/3192
Defensive patterns

Strategy: retry

Validate before calling

// No client-side validation can prevent an upstream schema change; retry on failure.
const result = await withRetry(() => dblpAuthor({ name }), 2);

Type guard

function hitHasPid(hit) {
  const url = hit?.info?.url;
  return typeof url === 'string' && /\/pid\/[a-z]+\/\d+/.test(url);
}

Try / catch

try {
  rows = await dblpAuthor({ name });
} catch (err) {
  if (/hit without a PID URL/.test(err.message)) {
    // fall back to manual PID
    rows = await dblpAuthor({ pid: KNOWN_PID });
  } else throw err;
}

Prevention

When it happens

Trigger: dblp /search/author/api returns a hit whose info object lacks the expected 'url' field containing '/pid/xx/nnn' — e.g. malformed/degraded API responses, or dblp changing the JSON schema of author hits.

Common situations: dblp API schema change after an update; hits that are non-author entities or partial records; transient dblp API issues returning incomplete JSON.

Related errors


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