jackwener/OpenCLI · error · TimeoutError
${config.site} login
Error message
${config.site} login What it means
registerSiteAuthCommands' login command polls the site for a logged-in identity and, if the user does not complete login within the --timeout window (default 300s), throws a TimeoutError with operation '<site> login'. The detail includes the last auth-check message plus a hint to run `opencli <site> login`. It means the interactive login was never detected as complete before the deadline.
Source
Thrown at clis/_shared/site-auth.js:111
}
await page.goto(config.loginUrl);
const timeoutSeconds = Number(kwargs.timeout ?? DEFAULT_TIMEOUT_SECONDS);
const deadline = Date.now() + timeoutSeconds * 1000;
let lastAuthMessage = '';
while (Date.now() < deadline) {
await page.wait(Math.min(POLL_INTERVAL_MS / 1000, Math.max(0.2, (deadline - Date.now()) / 1000)));
try {
const identity = await tryProbe(config, page, 'poll');
return { status: 'login_complete', ...identity };
} catch (error) {
if (!isAuthRequired(error)) throw error;
lastAuthMessage = getErrorMessage(error);
}
}
throw new TimeoutError(
`${config.site} login`,
timeoutSeconds,
lastAuthMessage ? `${authHint(config)} Last auth check: ${lastAuthMessage}` : authHint(config),
);
},
});
}
View on GitHub (pinned to 49907e53dc)
Solutions
- Re-run login with a larger --timeout, e.g. opencli <site> login --timeout 600, and complete login in the opened browser window.
- Complete the full login flow (including 2FA/captcha/email verification) before the window's deadline.
- Verify you can log in manually in a normal browser — the site flow itself may have changed.
- If headless, switch to foreground mode so the login page is visible and interactive.
Example fix
// before opencli example login # times out during 2FA // after opencli example login --timeout 600
Defensive patterns
Strategy: try-catch
Validate before calling
// check login state before starting the interactive flow
const who = await runCommand([site, 'whoami']);
if (!who.logged_in) console.log('Complete login in the opened browser window'); Try / catch
try {
await runCommand([site, 'login', '--timeout', '600']);
} catch (e) {
if (e instanceof TimeoutError && e.operation === `${site} login`) {
console.error('Login not completed in time; rerun with a larger --timeout');
} else throw e;
} Prevention
- Complete the full login flow (2FA, captcha, email verification) promptly
- Pass a generous --timeout (e.g. 600) when 2FA is involved
- Keep the login browser window open and in the foreground
- Verify manual login works in a normal browser first
When it happens
Trigger: Running `opencli <site> login --timeout N` and not finishing the site's login flow (credentials, 2FA, captcha) within N seconds; each poll raised AuthRequiredError until the deadline expired.
Common situations: Slow manual login with 2FA/SMS codes exceeding the default 5 minutes; user closes the browser window before finishing; site login page changed or login requires additional steps (email verification) so verification never passes; headless window where the user never saw the login page.
Related errors
- Browser session required for bilibili follow
- Browser session required for bilibili following
- coupang product wait failed: ${error?.message || error}
- flights.ctrip.com
- hotels.ctrip.com
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/1b5325ce8c373921.
Report an issue: GitHub.