{"record":{"id":"f89afd73a7765d07","repo":"jackwener/OpenCLI","slug":"weibo-user-posts-returned-malformed-extraction-pay","errorCode":null,"errorMessage":"weibo user-posts returned malformed extraction payload","messagePattern":"weibo user-posts returned malformed extraction payload","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/weibo/user-posts.js","lineNumber":206,"sourceCode":"              likes: post.attitudes_count ?? 0,\n              pic_count: post.pic_num ?? Object.keys(post.pic_infos || {}).length,\n              url: 'https://weibo.com/' + (user.id || uid) + '/' + mblogid,\n            });\n          }\n\n          if (list.length < 10) break;\n        }\n\n        return [uid, rows, sawList, sawPostCandidates];\n      })()\n    `);\n\n        const payload = unwrapEvaluateResult(evaluateResult);\n        if (payload && !Array.isArray(payload) && typeof payload === 'object' && 'error' in payload) {\n            mapError(payload.error);\n        }\n        if (!Array.isArray(payload) || payload.length !== 4 || !Array.isArray(payload[1])) {\n            throw new CommandExecutionError('weibo user-posts returned malformed extraction payload');\n        }\n        const [resolvedUid, rows, sawList, sawPostCandidates] = payload;\n        if (!sawList && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts did not observe a valid posts list');\n        }\n        if (sawPostCandidates && rows.length === 0) {\n            throw new CommandExecutionError('weibo user-posts found post candidates but could not extract valid rows');\n        }\n        if (rows.length === 0) {\n            throw new EmptyResultError('weibo user-posts', 'No Weibo posts found for this user/date range');\n        }\n\n        return rows.slice(0, limit).map((row, index) => ({\n            rank: index + 1,\n            id: String(row.id),\n            mblogid: row.mblogid || '',\n            author: row.author || '',\n            uid: String(row.uid || resolvedUid || ''),","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/weibo/user-posts.js#L188-L224","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isWellFormedPayload(p) {\n  return Array.isArray(p) && p.length === 4 && Array.isArray(p[1]);\n}","tryCatchPattern":"try {\n  const rows = await runUserPosts(opts);\n} catch (err) {\n  if (err instanceof CommandExecutionError && /malformed extraction payload/.test(err.message)) {\n    // page script contract broken: retry, refresh session, or update CLI\n  } else throw err;\n}","preventionTips":["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."],"tags":["contract-mismatch","weibo","extraction"],"backgroundTag":"malformed-payload","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}