jackwener/OpenCLI · error · CommandExecutionError

weibo delete: ${String(result.msg ?? result.error)}

Error message

weibo delete: ${String(result.msg ?? result.error)}

What it means

clis/weibo/delete.js:161 throws CommandExecutionError(`weibo delete: ${String(result.msg ?? result.error)}`) for logical API failures: error==='api' (Weibo returned an error payload), 'verify_malformed' (verify response couldn't be parsed), 'verify_mismatch' (verify returned a different post id), or 'still_exists' (post remained after the destroy call). The message carries Weibo's own msg text when available.

Source

Thrown at clis/weibo/delete.js:161

          return { ok: false, error: 'still_exists', id: idstr, mblogid: verifyBody.mblogid || mblogid };
        }
        if (!verifyBody.idstr || verifyBody.ok === 0) {
          return { ok: true, id: idstr, mblogid };
        }
        return { ok: false, error: 'verify_mismatch', msg: 'verify returned a different post id', id: idstr };
      })()
    `)), 'weibo delete');
        if (result.error === 'auth') {
            throw new AuthRequiredError('weibo.com', 'Cookie 已过期!请在当前 Chrome 浏览器中重新登录 Weibo。');
        }
        if (result.error === 'not_found') {
            throw new EmptyResultError('weibo delete', `Post not found for id "${String(result.input ?? raw)}". Verify the post still exists and belongs to the logged-in account.`);
        }
        if (result.error === 'show_http' || result.error === 'destroy_http' || result.error === 'verify_http') {
            throw new CommandExecutionError(`weibo delete: HTTP ${result.status}`);
        }
        if (result.error === 'api' || result.error === 'verify_malformed' || result.error === 'verify_mismatch' || result.error === 'still_exists') {
            throw new CommandExecutionError(`weibo delete: ${String(result.msg ?? result.error)}`);
        }
        if (!result.ok) {
            throw new CommandExecutionError('weibo delete returned an unexpected response');
        }
        return [{ status: 'deleted', id: String(result.id ?? ''), mblogid: String(result.mblogid ?? '') }];
    },
});

export const __test__ = {
    normalizePostId,
};

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Read the included result.msg — it is Weibo's own explanation (e.g. permission denied, risk control)
  2. Confirm you are deleting your own post and that the id is the mblogid of the post itself, not a repost target
  3. Reload weibo.com in Chrome and check whether the post actually disappeared (still_exists may be eventual consistency)
  4. If verify_malformed/mismatch recurs across posts, Weibo likely changed its response format — update the CLI

Example fix

// before: assuming delete succeeded
await cli.run('weibo delete', { id });
// after: verify post is gone
try {
  await cli.run('weibo delete', { id });
} catch (e) {
  if (/still_exists/.test(e.message)) console.warn('post may still exist; re-check later');
  throw e;
}
Defensive patterns

Strategy: try-catch

Type guard

function isWeiboApiLogicError(e) { return e instanceof Error && /weibo delete: (?!HTTP)/.test(e.message) && /(verify_|still_exists|api)/.test(e.message); }

Try / catch

try {
  await cli.run('weibo delete', { id });
} catch (e) {
  if (/still_exists/.test(e.message)) {
    await new Promise(r => setTimeout(r, 5000)); // eventual consistency; optionally re-verify
  } else if (/verify_mismatch/.test(e.message)) {
    console.error('id resolved to a different post; use the mblogid of the post itself');
  }
  throw e;
}

Prevention

When it happens

Trigger: The delete script completed its HTTP calls but the outcome was wrong: Weibo's destroy API returned ok:false with a message, the verification fetch returned unparseable JSON, verification resolved a different id, or the post still exists after deletion.

Common situations: Weibo silently rejecting deletes via risk control; deleting a repost whose verify resolves to the original; Weibo DOM/API response format changes breaking the page-side parser; eventual consistency where the post briefly remains after delete.

Related errors


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