jackwener/OpenCLI · error · CommandExecutionError
HTTP ${result.httpStatus} from /api/me.json
Error message
HTTP ${result.httpStatus} from /api/me.json What it means
CommandExecutionError thrown when the in-page fetch of /api/me.json in verifyRedditIdentity returns a non-OK status other than 401/403. Unlike the auth kinds, this is treated as a general HTTP failure of the identity probe, not a login problem.
Source
Thrown at clis/reddit/auth.js:33
const result = await page.evaluate(`(async () => {
try {
const res = await fetch('/api/me.json', { credentials: 'include', headers: { 'Accept': 'application/json' } });
if (res.status === 401 || res.status === 403) {
return { kind: 'auth', detail: 'Reddit /api/me.json HTTP ' + res.status };
}
if (!res.ok) return { kind: 'http', httpStatus: res.status };
const d = await res.json();
const data = d && d.data;
if (!data || !data.name) {
return { kind: 'auth', detail: 'Reddit /api/me.json 200 but no data.name — anonymous' };
}
return { ok: true, username: String(data.name), id: String(data.id || '') };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`);
if (result?.kind === 'auth') throw new AuthRequiredError('reddit.com', result.detail);
if (result?.kind === 'http') throw new CommandExecutionError(`HTTP ${result.httpStatus} from /api/me.json`);
if (result?.kind === 'exception') throw new CommandExecutionError(`Reddit whoami failed: ${result.detail}`);
if (!result?.ok) throw new CommandExecutionError(`Unexpected Reddit probe: ${JSON.stringify(result)}`);
return { username: result.username, id: result.id };
}
registerSiteAuthCommands({
site: 'reddit',
domain: 'reddit.com',
loginUrl: 'https://www.reddit.com/login',
columns: ['username', 'id'],
quickCheck: hasRedditSessionCookie,
verify: verifyRedditIdentity,
poll: async (page) => {
if (!await hasRedditSessionCookie(page)) {
throw new AuthRequiredError('reddit.com', 'Waiting for Reddit reddit_session cookie');
}
return verifyRedditIdentity(page);
},View on GitHub (pinned to 49907e53dc)
Solutions
- Wait briefly and retry; check https://www.redditstatus.com for a Reddit outage.
- Reduce polling frequency — a 429 means you're being rate-limited; back off.
- Inspect the status in the message; if it's 429 add delays/backoff around repeated auth checks.
- Verify no proxy/VPN is injecting error responses for www.reddit.com.
Example fix
// before: tight poll loop hitting /api/me.json
while (true) { await verifyRedditIdentity(page); }
// after: backoff on failure
try { await verifyRedditIdentity(page); } catch (e) { await new Promise(r => setTimeout(r, 30_000)); } Defensive patterns
Strategy: retry
Validate before calling
// probe Reddit availability first
const health = await fetch('https://www.reddit.com/api/me.json');
if (health.status >= 500 || health.status === 429) await backoff(); Try / catch
try {
await opencli.reddit.whoami();
} catch (e) {
if (/HTTP \d+ from \/api\/me\.json/.test(e.message) && attempts < 3) {
await sleep(5000 * attempts);
return retry();
}
throw e;
} Prevention
- Add exponential backoff around Reddit probes.
- Watch for 429 and reduce polling frequency accordingly.
- Monitor redditstatus.com during incidents instead of hammering the API.
- Route through a stable network; avoid proxies that inject error statuses.
When it happens
Trigger: Reddit's /api/me.json responds with 5xx or other unexpected statuses (e.g. 429 rate limit, 502/503 from Reddit's edge) while the session cookie passes the quick cookie check.
Common situations: Reddit outage or degraded service; aggressive polling tripping Reddit rate limiting (429); corporate proxy intercepting and returning its own error status.
Related errors
- autohome ${contextHint} HTTP ${resp.status}
- Ctrip flight API returned HTTP ${status || 'unknown'}
- dongchedi ${contextHint} HTTP ${resp.status}
- eastmoney convertible failed: HTTP ${resp.status}
- HTTP_ERROR
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/e4f8e5ace107cf8a.
Report an issue: GitHub.