jackwener/OpenCLI · error · CommandExecutionError
Please verify your linux.do session is still valid
Error message
Please verify your linux.do session is still valid
What it means
This is the remediation hint attached to a CommandExecutionError raised when the browser response is not ok but carries an error payload (result.error set). The primary message is the underlying error from the browser fetch; 'Please verify your linux.do session is still valid' is the human-facing hint. The library assumes most non-auth non-ok outcomes with error text stem from a degraded or stale session.
Source
Thrown at clis/linux-do/feed.js:109
};
} catch (error) {
return {
ok: false,
error: error instanceof Error ? error.message : String(error),
};
}
})()`);
if (!result) {
throw new CommandExecutionError('linux.do returned an empty browser response');
}
if (result.status === 401 || result.status === 403) {
throw new AuthRequiredError('linux.do', 'linux.do requires an active signed-in browser session');
}
if (!result.ok) {
throw new CommandExecutionError(result.error || `linux.do request failed: HTTP ${result.status ?? 'unknown'}`);
}
if (result.error) {
throw new CommandExecutionError(result.error, 'Please verify your linux.do session is still valid');
}
return result.data;
}
function findMatchingTag(records, value) {
const raw = value.trim();
const normalized = normalizeLookupValue(value);
return /^\d+$/.test(raw)
? records.find((item) => item.id === Number(raw)) ?? null
: records.find((item) => normalizeLookupValue(item.name) === normalized)
?? records.find((item) => normalizeLookupValue(item.slug) === normalized)
?? null;
}
function findMatchingCategory(records, value) {
const raw = value.trim();
const normalized = normalizeLookupValue(value);
return /^\d+$/.test(raw)
? records.find((item) => item.id === Number(raw)) ?? null
: records.find((item) => categoryLookupKeys(item).includes(normalized))View on GitHub (pinned to 49907e53dc)
Solutions
- Sign in again to linux.do in the browser the CLI automates to refresh the session
- Re-run the same command after re-authenticating; transient challenges usually clear
- Inspect the primary error text above the hint for the real cause (block page, navigation failure, etc.)
- If it persists, use a regular (non-headless) browser profile and confirm the site loads manually
Example fix
// before throw new CommandExecutionError(result.error); // opaque failure, user can't tell why // after (already handled by library) throw new CommandExecutionError(result.error, 'Please verify your linux.do session is still valid'); // user action: re-login to linux.do in the automated browser, then retry
Defensive patterns
Strategy: try-catch
Validate before calling
// Verify session before the call
const probe = await execCommand(`(async () => {
const r = await fetch('https://linux.do/session/current.json');
return { ok: r.ok, status: r.status };
})()`);
if (!probe || !probe.ok) throw new Error('linux.do session invalid — re-login in the automated browser'); Type guard
function isSessionValidResult(result) {
return Boolean(result) && typeof result === 'object' &&
result.ok === true && typeof result.data !== 'undefined';
} Try / catch
import { CommandExecutionError } from '@jackwener/opencli/errors';
try {
const topics = await data();
} catch (err) {
if (err instanceof CommandExecutionError && /verify your linux\.do session/.test(String(err.hint || err.message))) {
console.error('Session degraded — sign in to linux.do again in the automated browser, then retry.');
} else {
throw err;
}
} Prevention
- Re-login to linux.do whenever the CLI reports session-related hints
- Use a persistent browser profile so cookies survive restarts
- Avoid running the CLI during Cloudflare challenge storms; complete challenges manually first
- Don't partially clear browser storage for the profile the CLI drives
When it happens
Trigger: fetchLinuxDoJson receives result.ok === false AND result.error is a non-empty string (e.g. the browser wrapper reports 'not logged in', 'blocked by Cloudflare', or a navigation failure); raised from any linux-do command consuming data or subData.
Common situations: linux.do invalidated the session mid-use; the automated browser hit a Cloudflare challenge; the browser profile's cookies were partially cleared; a headless browser failed navigation but returned error text with a non-ok flag.
Related errors
- linux.do requires an active signed-in browser session
- Browser session required for zhihu answer
- 12306 whoami failed: ${probe.detail}
- Bilibili creator-center login is required: ${message}
- Bilibili creator-center login is required: ${detail}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c1121e2c02c51aec.
Report an issue: GitHub.