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
- Check https://maimai.cn/ in a normal browser to see if the site is up or blocking you
- If 403/anti-bot, use a real logged-in Chrome profile and disable headless automation signals
- Retry later if it's a 5xx outage
- 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
- Check maimai.cn availability in a normal browser first
- Use a residential network/avoid proxies that trigger WAF blocks
- Retry with backoff on 5xx; don't hammer the endpoint
- Run with a real, non-headless logged-in Chrome profile to reduce bot detection
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
- Server returned HTML instead of JSON (status=${value.status}
- 12306 queryByTrainNo returned HTTP ${resp.status}
- 12306 queryByTrainNo returned non-JSON body
- 12306 ${endpoint} returned non-JSON body
- 1point3acres request failed: HTTP ${res.status} ${res.status
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/236d25d2fa3ec66d.
Report an issue: GitHub.