jackwener/OpenCLI · error · CommandExecutionError

HTTP ${probe.httpStatus} from Maimai

Error message

HTTP ${probe.httpStatus} from Maimai

What it means

Thrown at clis/maimai/auth.js:34 when the probe result has kind:'http', wrapping the HTTP status of a failed page load as `HTTP <status> from Maimai`. It indicates verifyMaimaiIdentity could not obtain a healthy maimai.cn page (note: the current WHOAMI_PROBE never emits kind 'http'; this branch is a defensive path for probe variants/envs that do).

Source

Thrown at clis/maimai/auth.js:34

    }
    if (!user || !user.id) return { kind: 'auth', detail: 'Maimai userObj missing from page (anonymous)' };
    return {
      ok: true,
      user_id: String(user.id),
      name: String(user.name || ''),
      company: String(user.company || ''),
    };
  } catch (e) {
    return { kind: 'exception', detail: String(e && e.message || e) };
  }
})()`;

async function verifyMaimaiIdentity(page) {
  await page.goto('https://maimai.cn/');
  await page.wait(2);
  const probe = await page.evaluate(WHOAMI_PROBE);
  if (probe?.kind === 'auth') throw new AuthRequiredError('maimai.cn', probe.detail);
  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Maimai`);
  if (probe?.kind === 'exception') throw new CommandExecutionError(`Maimai whoami failed: ${probe.detail}`);
  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Maimai probe: ${JSON.stringify(probe)}`);
  return { user_id: probe.user_id, name: probe.name, company: probe.company };
}

registerSiteAuthCommands({
  site: 'maimai',
  domain: 'maimai.cn',
  loginUrl: 'https://maimai.cn/',
  columns: ['user_id', 'name', 'company'],
  verify: verifyMaimaiIdentity,
  poll: verifyMaimaiIdentity,
});

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check https://maimai.cn/ in a normal browser to see if the site is up or blocking you
  2. If 403/anti-bot, use a real logged-in Chrome profile and disable headless automation signals
  3. Retry later if it's a 5xx outage
  4. Check proxy/VPN settings that might alter the response

Example fix

// before
await verifyMaimaiIdentity(page);
// after
try {
  await verifyMaimaiIdentity(page);
} catch (e) {
  if (/HTTP 5\d\d from Maimai/.test(e.message)) {
    await new Promise(r => setTimeout(r, 10000));
    return verifyMaimaiIdentity(page);
  }
  throw e;
}
Defensive patterns

Strategy: retry

Validate before calling

// pre-check site reachability
const res = await fetch('https://maimai.cn/', { method: 'HEAD' });
if (res.status >= 500) throw new Error(`maimai.cn is unhealthy: HTTP ${res.status}`);

Type guard

function isMaimaiHttpError(e) {
  return e instanceof Error && /^HTTP \d{3} from Maimai$/.test(e.message);
}

Try / catch

try {
  await verifyMaimaiIdentity(page);
} catch (e) {
  if (isMaimaiHttpError(e) && /5\d\d/.test(e.message)) {
    await sleep(10000);
    return verifyMaimaiIdentity(page);
  }
  throw e;
}

Prevention

When it happens

Trigger: A probe reporting kind:'http' with an httpStatus — i.e. page.goto to https://maimai.cn/ returned an error status (5xx, 403 WAF block) or a browser fetch interceptor reported one, before the whoami script could run.

Common situations: Maimai WAF/anti-bot blocking the automation browser; maimai.cn outage or 5xx; network proxy returning an error page; geo-blocking of the maimai homepage.

Related errors


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