jackwener/OpenCLI · error · CommandExecutionError
HTTP ${result.httpStatus} from Instagram /users/info
Error message
HTTP ${result.httpStatus} from Instagram /users/info What it means
A CommandExecutionError thrown when the whoami probe to Instagram's /api/v1/users/<uid>/info/ returns a non-ok status other than 401/403 (which would be auth errors instead). The library classifies this as a command-level HTTP failure rather than an auth problem, because the session may be fine but the API itself failed. The status code in the message indicates the actual problem.
Source
Thrown at clis/instagram/auth.js:38
credentials: 'include',
headers: { 'X-IG-App-ID': '936619743392459', 'Accept': 'application/json' },
});
if (r.status === 401 || r.status === 403) {
return { kind: 'auth', detail: 'Instagram /users/info HTTP ' + r.status };
}
if (!r.ok) return { kind: 'http', httpStatus: r.status };
const d = await r.json();
const user = d?.user;
if (!user || !user.pk) {
return { kind: 'auth', detail: 'Instagram /users/info returned no pk — session likely expired' };
}
return { ok: true, user_id: String(user.pk), username: String(user.username || ''), full_name: String(user.full_name || '') };
} catch (e) {
return { kind: 'exception', detail: String(e && e.message || e) };
}
})()`);
if (result?.kind === 'auth') throw new AuthRequiredError('www.instagram.com', result.detail);
if (result?.kind === 'http') throw new CommandExecutionError(`HTTP ${result.httpStatus} from Instagram /users/info`);
if (result?.kind === 'exception') throw new CommandExecutionError(`Instagram whoami failed: ${result.detail}`);
if (!result?.ok) throw new CommandExecutionError(`Unexpected Instagram probe: ${JSON.stringify(result)}`);
return { user_id: result.user_id, username: result.username, full_name: result.full_name };
}
registerSiteAuthCommands({
site: 'instagram',
domain: 'instagram.com',
loginUrl: 'https://www.instagram.com/accounts/login/',
columns: ['user_id', 'username', 'full_name'],
quickCheck: hasInstagramSessionCookie,
verify: verifyInstagramIdentity,
poll: async (page) => {
if (!await hasInstagramSessionCookie(page)) {
throw new AuthRequiredError('www.instagram.com', 'Waiting for Instagram sessionid cookie');
}
return verifyInstagramIdentity(page);
},View on GitHub (pinned to 49907e53dc)
Solutions
- If status is 429, wait several minutes before retrying — Instagram rate limits the account/IP
- For 5xx, retry after a short delay; usually transient
- Reduce request frequency and add delays between Instagram CLI invocations
- Retry after confirming you can browse instagram.com normally in the same browser profile
Example fix
// retry wrapper around the failing command
async function whoamiWithRetry(cmd, attempts = 3) {
for (let i = 0; i < attempts; i++) {
try { return await cmd(); }
catch (e) {
if (!/HTTP 5\d\d|HTTP 429/.test(e.message) || i === attempts - 1) throw e;
await new Promise(r => setTimeout(r, 60000));
}
}
} Defensive patterns
Strategy: retry
Validate before calling
null
Type guard
null
Try / catch
try {
await instagramWhoami();
} catch (e) {
const m = e.message.match(/HTTP (\d+) from Instagram \/users\/info/);
if (m && (m[1] === '429' || m[1].startsWith('5'))) {
await sleep(m[1] === '429' ? 120000 : 5000);
return instagramWhoami();
}
throw e;
} Prevention
- Rate-limit your Instagram automation; 429 means the account/IP is throttled
- Retry 5xx with exponential backoff; they are usually transient
- Note that 401/403 are surfaced as auth errors instead — route those to login, not retry
- Monitor for repeated 429s and back off globally rather than per-command
When it happens
Trigger: Inside the verifyInstagramIdentity page.evaluate probe, the fetch to /api/v1/users/<uid>/info/ with credentials:'include' and X-IG-App-ID header returns a status like 429 or 5xx, so the script returns {kind:'http', httpStatus}.
Common situations: Instagram rate limiting the account after heavy automated use (429); transient Instagram server errors (5xx); a network middlebox/proxy returning an unexpected response inside the page context.
Related errors
- Chess.com API returned HTTP ${resp.status} for ${url}
- Instagram did not keep the ${shouldLike ? 'like' : 'unlike'}
- ${label} failed: HTTP ${response.status}
- HTTP ' + res.status + ' - make sure you are logged in to Ins
- Failed to follow: HTTP ' + r2.status
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/760b69f5fffb18c8.
Report an issue: GitHub.