jackwener/OpenCLI · error · CommandExecutionError
Pixiv whoami failed: ${probe.detail}
Error message
Pixiv whoami failed: ${probe.detail} What it means
The in-page identity probe is wrapped in try/catch; any exception thrown while parsing global-data, fetching /ajax/user/extra, or reading cookies is converted to kind='exception' with the error message. verifyPixivIdentity then rethrows it as this CommandExecutionError. This means the probe script itself crashed rather than pixiv returning a structured auth/http answer.
Source
Thrown at clis/pixiv/auth.js:46
if (r.status === 401 || r.status === 403) {
return { kind: 'auth', detail: 'Pixiv /ajax/user/extra HTTP ' + r.status };
}
if (!r.ok) return { kind: 'http', httpStatus: r.status };
const d = await r.json();
if (d?.error) return { kind: 'auth', detail: 'Pixiv /ajax/user/extra error=true — anonymous' };
const phpSess = (document.cookie.split('; ').find(c => c.startsWith('PHPSESSID=')) || '').split('=')[1] || '';
const uid = phpSess.split('_')[0] || '';
if (!uid) {
return { kind: 'auth', detail: 'Pixiv PHPSESSID prefix unparseable' };
}
return { ok: true, user_id: uid, name: '' };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`);
if (probe?.kind === 'auth') throw new AuthRequiredError('pixiv.net', probe.detail);
if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from Pixiv ajax`);
if (probe?.kind === 'exception') throw new CommandExecutionError(`Pixiv whoami failed: ${probe.detail}`);
if (!probe?.ok) throw new CommandExecutionError(`Unexpected Pixiv probe: ${JSON.stringify(probe)}`);
return { user_id: probe.user_id, name: probe.name };
}
registerSiteAuthCommands({
site: 'pixiv',
domain: 'pixiv.net',
loginUrl: 'https://accounts.pixiv.net/login',
columns: ['user_id', 'name'],
quickCheck: hasPixivSessionCookie,
verify: verifyPixivIdentity,
poll: async (page) => {
if (!await hasPixivSessionCookie(page)) {
throw new AuthRequiredError('pixiv.net', 'Waiting for Pixiv PHPSESSID cookie');
}
return verifyPixivIdentity(page);
},
});View on GitHub (pinned to 49907e53dc)
Solutions
- Read the embedded detail in the message to see the underlying exception and fix accordingly.
- Reload pixiv.net and retry — the page may have been mid-navigation or served an interstitial.
- Retry after clearing bot-protection (solve any challenge) in the browser profile.
- Update the probe if pixiv changed its page structure or cookie access rules.
Defensive patterns
Strategy: try-catch
Try / catch
try {
await pixivWhoAmI();
} catch (err) {
if (String(err.message).startsWith('Pixiv whoami failed:')) {
// log the inner detail, reload pixiv.net, retry once
await page.goto('https://www.pixiv.net/');
await pixivWhoAmI();
} else throw err;
} Prevention
- Keep the browser parked on a fully loaded pixiv.net page before probing.
- Disable extensions/strict cookie policies in the automation profile.
- Log the inner detail from the message to distinguish JSON-parse vs DOM failures.
- Retry once after a page reload — many causes are transient interstitials.
When it happens
Trigger: The probe's async IIFE throws: r.json() fails on a non-JSON (HTML/CDN error) response, a CSP/security change blocks fetch or document.cookie access, or an unexpected DOM/network exception occurs during page.evaluate.
Common situations: Bot-protection page serving HTML where JSON was expected; browser extension or strict cookie policy hiding document.cookie; pixiv JS/DOM changes breaking the probe; navigation interrupting the evaluate.
Related errors
- Unexpected Chaoxing probe: ${JSON.stringify(probe)}
- Pixiv PHPSESSID prefix unparseable
- Unexpected Pixiv probe: ${JSON.stringify(probe)}
- Failed to parse 12306 station_name.js: source string not fou
- Failed to parse 12306 station_name.js: no station records fo
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/8e9a8dbb7ff19c86.
Report an issue: GitHub.