jackwener/OpenCLI · error · CommandExecutionError
${formatLabel} citation page returned an empty response
Error message
${formatLabel} citation page returned an empty response What it means
After navigating to the citation export URL (e.g. the BibTeX endpoint), the code reads document.body.innerText; if it is empty it throws CommandExecutionError `${formatLabel} citation page returned an empty response`. It means the remote citation page loaded but delivered no content.
Source
Thrown at clis/google-scholar/cite.js:69
for (var i = 0; i < links.length; i++) {
if (links[i].textContent.trim() === '${formatLabel}') return links[i].href;
}
return null;
})()`);
if (!citeUrl) {
throw new CommandExecutionError(`Could not find ${formatLabel} citation link for result ${index + 1}`);
}
await page.goto(citeUrl);
await page.wait(2);
const citation = await page.evaluate(`(() => {
return (document.body.innerText || '').trim();
})()`);
if (!citation) {
throw new CommandExecutionError(`${formatLabel} citation page returned an empty response`);
}
return [{ title: clicked.title, format: format, citation }];
},
});
View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the citation fetch after a short backoff
- Slow the overall rate of Scholar requests to avoid throttling
- Re-run the search and cite flow if the session went stale
- Verify connectivity; capture the page URL/status to distinguish rate-limit pages
Example fix
// before
const citation = await scholarCite(page, i, 'bibtex');
// after
try { citation = await scholarCite(page, i, 'bibtex'); }
catch (e) {
if (/empty response/.test(e.message)) { await page.wait(5); citation = await scholarCite(page, i, 'bibtex'); }
else throw e;
} Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
null
Try / catch
try { out = await scholarCite(page, i, fmt); }
catch (e) { if (/empty response/.test(e.message)) { await page.wait(5); out = await scholarCite(page, i, fmt); } else throw e; } Prevention
- Add backoff between citation fetches to avoid throttling
- Retry transient empty responses after a short wait
- Log the citeUrl on failure to diagnose rate-limit or endpoint changes
When it happens
Trigger: page.goto(citeUrl) returning a blank/error body; Scholar rate limiting returning an empty page; network hiccup producing a truncated response; the 2s wait being insufficient for content injection.
Common situations: Bulk citation harvesting triggering Scholar throttling; transient network failures; endpoint changes returning empty bodies instead of content.
Related errors
- Could not find ${formatLabel} citation link for result ${ind
- Working tree not clean: ${status}
- Detached HEAD — checkout a branch first
- Booking.com page returned no extractable data
- Empty response from Douyin API (${method} ${url})
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/552343670cf0b016.
Report an issue: GitHub.