{"record":{"id":"f47aa2527728ddb7","repo":"jackwener/OpenCLI","slug":"please-verify-your-linux-do-session-is-still-valid-f47aa2","errorCode":null,"errorMessage":"Please verify your linux.do session is still valid","messagePattern":"Please verify your linux\\.do session is still valid","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"warning","filePath":"clis/linux-do/topic-content.js","lineNumber":119,"sourceCode":"        ok: false,\n        error: error instanceof Error ? error.message : String(error),\n      };\n    }\n  })()`);\n    if (!result) {\n        throw new CommandExecutionError('linux.do returned an empty browser response');\n    }\n    if (result.status === 401 || result.status === 403) {\n        throw new AuthRequiredError(LINUX_DO_DOMAIN, 'linux.do requires an active signed-in browser session');\n    }\n    if (result.error === 'Response is not valid JSON') {\n        throw new AuthRequiredError(LINUX_DO_DOMAIN, 'linux.do requires an active signed-in browser session');\n    }\n    if (!result.ok) {\n        throw new CommandExecutionError(result.error || `linux.do request failed: HTTP ${result.status ?? 'unknown'}`);\n    }\n    if (result.error) {\n        throw new CommandExecutionError(result.error, 'Please verify your linux.do session is still valid');\n    }\n    return result.data;\n}\ncli({\n    site: 'linux-do',\n    name: 'topic-content',\n    access: 'read',\n    description: 'Get the main topic body as Markdown',\n    domain: LINUX_DO_DOMAIN,\n    strategy: Strategy.COOKIE,\n    browser: true,\n    defaultFormat: 'plain',\n    args: [\n        { name: 'id', positional: true, type: 'int', required: true, help: 'Topic ID' },\n    ],\n    columns: ['content'],\n    func: async (page, kwargs) => {\n        const id = Number(kwargs.id);","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linux-do/topic-content.js#L101-L137","documentation":"When the fetch succeeded (result.ok true) but result.error is still set, the library treats it as a session-quality problem and throws CommandExecutionError with the hint 'Please verify your linux.do session is still valid'. It signals the response may be unreliable because of a degraded login state.","triggerScenarios":"The in-page fetch wrapper sets result.error despite ok — e.g. partial response parse issues, cookie refresh prompts, or the wrapper flagging anomalies while still returning data.","commonSituations":"Session about to expire (linux.do forced-logout imminent); concurrent sessions invalidating cookies; site serving degraded content to a stale session.","solutions":["Re-authenticate: sign out and sign in again in the CLI's browser.","Clear linux.do cookies for the managed profile and log in fresh.","Reduce concurrent sessions on the same account.","Retry the request after refreshing the session."],"exampleFix":"// before\ncli --site linux-do --name topic-content 12345   // session-hint error\n// after\ncli --site linux-do logout && cli --site linux-do login\ncli --site linux-do --name topic-content 12345","handlingStrategy":"try-catch","validationCode":"const stale = await page.evaluate(() => document.body?.innerText?.includes('log in') ?? false);\nif (stale) console.warn('linux.do session looks stale; re-login recommended');","typeGuard":"const isSessionHintError = (e) => /verify your linux\\.do session/.test(e?.message ?? '');","tryCatchPattern":"try {\n  return await fetchTopicPayload(page, id);\n} catch (e) {\n  if (isSessionHintError(e)) {\n    console.error('Refresh your linux.do login and retry.');\n  } else throw e;\n}","preventionTips":["Re-login periodically; linux.do sessions expire","Avoid concurrent logins on the same account","Detect login-page markers before batch fetches"],"tags":["auth","session","discourse"],"backgroundTag":"session-expired","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}