jackwener/OpenCLI · warning · AuthRequiredError

Waiting for Weibo SUB / SUBP cookies

Error message

Waiting for Weibo SUB / SUBP cookies

What it means

During interactive login, the poll loop repeatedly checks whether the Weibo SUB/SUBP session cookies have been set. Until they appear, it throws AuthRequiredError with this message instead of running full identity verification. It signals 'login not finished yet', not a hard failure — the login flow keeps polling until timeout.

Source

Thrown at clis/weibo/auth.js:67

  if (result?.kind === 'exception') throw new CommandExecutionError(`Weibo whoami failed: ${result.detail}`);
  if (!result || Array.isArray(result) || typeof result !== 'object') {
    throw new CommandExecutionError('Weibo whoami returned malformed probe payload');
  }
  if (!result?.ok) throw new CommandExecutionError(`Unexpected Weibo probe: ${JSON.stringify(result)}`);
  if (!result.user_id) throw new CommandExecutionError('Weibo whoami returned no user id');
  return { user_id: result.user_id, screen_name: result.screen_name, profile_url: result.profile_url };
}

registerSiteAuthCommands({
  site: 'weibo',
  domain: 'weibo.com',
  loginUrl: 'https://weibo.com/login',
  columns: ['user_id', 'screen_name', 'profile_url'],
  quickCheck: hasWeiboSessionCookie,
  verify: verifyWeiboIdentity,
  poll: async (page) => {
    if (!await hasWeiboSessionCookie(page)) {
      throw new AuthRequiredError('weibo.com', 'Waiting for Weibo SUB / SUBP cookies');
    }
    return verifyWeiboIdentity(page);
  },
});

export const __test__ = { buildWeiboIdentityProbe, verifyWeiboIdentity };

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Complete the QR scan or credential login in the opened browser before the poll timeout
  2. Confirm login happened in the same browser profile/context the CLI controls
  3. Check that cookies are enabled and no extension blocks weibo.com cookies
  4. Retry the login; if it persists, verify the session manually and reuse that browser profile

Example fix

null
Defensive patterns

Strategy: retry

Validate before calling

// check session cookies before starting the interactive flow
if (!(await hasWeiboSessionCookie(page))) {
  console.log('Complete the Weibo login in the opened browser...');
}

Type guard

function isAuthRequired(err) {
  return err instanceof AuthRequiredError || /Waiting for Weibo SUB \/ SUBP/.test(err.message);
}

Try / catch

try {
  identity = await pollWeiboLogin(page);
} catch (err) {
  if (isAuthRequired(err)) {
    console.log('Login not detected yet — rescan the QR code or retry weibo login');
  } else throw err;
}

Prevention

When it happens

Trigger: The poll callback runs while the user has not completed QR-code/credential login, or login completed on a different browser context/profile than the one being polled, so the weibo.com domain cookies SUB and SUBP were never set.

Common situations: User scans the QR code too slowly (or not at all) during the login window, login is done in a different Chrome profile, cookies blocked by browser settings/extensions, or Weibo moved/renamed its session cookies.

Related errors


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