jackwener/OpenCLI · error · CommandExecutionError
Bilibili creator comparison returned duplicate rows for ${bv
Error message
Bilibili creator comparison returned duplicate rows for ${bvid} What it means
After whitelisting each row, selectTarget collects rows whose bvid equals the requested bvid. If more than one row matches, the result would be ambiguous (which stat block is authoritative?), so the library throws this CommandExecutionError naming the duplicated bvid rather than picking an arbitrary row.
Source
Thrown at clis/bilibili/creator-stats.js:102
throw new TimeoutError('Bilibili creator comparison', FETCH_TIMEOUT_SECONDS);
}
if (/HTTP\s+(401|403)|登录|passport|\/login\b/i.test(detail)) {
throw new AuthRequiredError('member.bilibili.com', `Bilibili creator-center login is required: ${detail}`);
}
throw new CommandExecutionError(`Bilibili creator comparison request failed: ${detail}`);
}
}
function selectTarget(list, bvid) {
const matches = [];
for (const item of list) {
if (!isRecord(item) || typeof item.bvid !== 'string' || !/^BV[0-9A-Za-z]{10}$/.test(item.bvid)) {
throw new CommandExecutionError('Bilibili creator comparison returned a malformed manuscript row');
}
if (item.bvid === bvid) matches.push(item);
}
if (matches.length > 1) {
throw new CommandExecutionError(`Bilibili creator comparison returned duplicate rows for ${bvid}`);
}
if (matches.length === 0) {
throw new EmptyResultError(
`bilibili creator-stats ${bvid}`,
'The manuscript was not present in the latest 100 creator analytics rows; it may be older, not owned by this account, or not analyzed yet.',
);
}
const target = matches[0];
if (!isRecord(target.stat)) {
throw new CommandExecutionError(`Bilibili creator comparison returned malformed stat data for ${bvid}`);
}
return target;
}
function metricValue(target, definition) {
const source = definition.source === 'target' ? target : target.stat;
if (!Object.prototype.hasOwnProperty.call(source, definition.key)) {
throw new CommandExecutionError(`Bilibili creator comparison omitted metric ${definition.key}`);View on GitHub (pinned to 49907e53dc)
Solutions
- Log the full list and confirm the duplication is server-side (not caused by your own merging code)
- Update selectTarget to deduplicate by bvid (e.g. keep the first row) if duplicates are benign
- Retry later — if it is a transient Bilibili-side glitch, a fresh fetch may return clean rows
- Report/track the endpoint anomaly since the endpoint is undocumented and unstable
Example fix
// before: throw on duplicates
if (matches.length > 1) {
throw new CommandExecutionError(`...duplicate rows for ${bvid}`);
}
// after: tolerate duplicates deterministically
const target = matches[0]; Defensive patterns
Strategy: fallback
Try / catch
try {
const rows = await runCommand();
} catch (e) {
if (/duplicate rows for/.test(e.message)) {
// retry once; if persistent, deduplicate by bvid (first occurrence) upstream
} else throw e;
} Prevention
- Deduplicate list rows by bvid before analysis if the endpoint is known to duplicate
- Retry on first occurrence — duplication may be a transient server glitch
- Record the raw payload when this fires to confirm whether it is server-side
When it happens
Trigger: payload.data.list contains two or more entries with the same bvid as the requested manuscript — e.g. Bilibili returning the video once per analytics dimension or paging overlap within the size=100 window.
Common situations: Bilibili server returning duplicated rows in the comparison payload; endpoint behavior change duplicating entries across pages/dimensions; retried fetches concatenating results in an intermediate layer.
Related errors
- Bilibili creator comparison returned a malformed manuscript
- Bilibili creator comparison API returned a malformed envelop
- Bilibili creator comparison API returned malformed list data
- Bilibili view API returned duplicate page entries for p=${pa
- Suno generation returned malformed clip identity.
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/2767e1727f9073d7.
Report an issue: GitHub.