jackwener/OpenCLI · error · CommandExecutionError
weibo user-posts returned malformed extraction payload
Error message
weibo user-posts returned malformed extraction payload
What it means
The command expects the in-page extraction script to return a payload of exactly [resolvedUid, rows, sawList, sawPostCandidates] — a 4-element array whose second element is an array. If the evaluate result is anything else (non-array, wrong arity, rows not an array), the payload is considered malformed and this CommandExecutionError is thrown, indicating the page script and the CLI contract are out of sync or the extractor did not run as expected.
Source
Thrown at clis/weibo/user-posts.js:206
likes: post.attitudes_count ?? 0,
pic_count: post.pic_num ?? Object.keys(post.pic_infos || {}).length,
url: 'https://weibo.com/' + (user.id || uid) + '/' + mblogid,
});
}
if (list.length < 10) break;
}
return [uid, rows, sawList, sawPostCandidates];
})()
`);
const payload = unwrapEvaluateResult(evaluateResult);
if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {
mapError(payload.error);
}
if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {
throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');
}
const [resolvedUid, rows, sawList, sawPostCandidates] = payload;
if (!sawList && rows.length === 0) {
throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');
}
if (sawPostCandidates && rows.length === 0) {
throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');
}
if (rows.length === 0) {
throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');
}
return rows.slice(0, limit).map((row, index) => ({
rank: index + 1,
id: String(row.id),
mblogid: row.mblogid || '',
author: row.author || '',
uid: String(row.uid || resolvedUid || ''),View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command to rule out a transient page-load problem.
- Refresh cookies/re-login and retry, since interstitial pages can break the extractor.
- Check for a newer version of the CLI that supports the current Weibo page structure.
- If reproducible, capture the page HTML at failure time and compare against the extractor's expected selectors.
Defensive patterns
Strategy: try-catch
Type guard
function isWellFormedPayload(p) {
return Array.isArray(p) && p.length === 4 && Array.isArray(p[1]);
} Try / catch
try {
const rows = await runUserPosts(opts);
} catch (err) {
if (err instanceof CommandExecutionError && /malformed extraction payload/.test(err.message)) {
// page script contract broken: retry, refresh session, or update CLI
} else throw err;
} Prevention
- Retry on first occurrence — often a transient render/navigation issue.
- Refresh cookies if interstitial pages appear.
- Update the CLI when Weibo changes its page structure.
- Report persistent occurrences with the captured page HTML.
When it happens
Trigger: The evaluated script returns null/undefined, an object without an 'error' key, an array of length other than 4, or a 4-element array whose rows slot is not an array.
Common situations: Weibo page redesign so the injected script errors and returns a different value, page redirecting to a verification/login interstitial mid-evaluation, or the extractor being blocked by page CSP.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- weibo delete returned an unexpected response
- message
- weibo user-posts did not observe a valid posts list
- weibo user-posts found post candidates but could not extract
- ${label}: ${String(payload.error)}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/f89afd73a7765d07.
Report an issue: GitHub.