{"record":{"id":"34dc9aa1d9143044","repo":"jackwener/OpenCLI","slug":"open-chrome-and-log-in-to-facebook-before-retrying","errorCode":null,"errorMessage":"Open Chrome and log in to Facebook before retrying.","messagePattern":"Open Chrome and log in to Facebook before retrying\\.","errorType":"error_code","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/facebook/feed.js","lineNumber":372,"sourceCode":"\n  await loadFeedPosts(page, limit);\n\n  let payload;\n  try {\n    payload = unwrapBrowserResult(await page.evaluate(buildFeedExtractScript(limit)));\n  } catch (err) {\n    throw new CommandExecutionError(\n      `Failed to read facebook feed: ${err instanceof Error ? err.message : err}`,\n      'Facebook may not have rendered or the feed markup may have changed.',\n    );\n  }\n\n  if (!payload || typeof payload !== 'object' || !Array.isArray(payload.rows)) {\n    throw new CommandExecutionError('facebook feed returned malformed extraction payload');\n  }\n\n  if (payload.status === 'auth') {\n    throw new AuthRequiredError('www.facebook.com', 'Open Chrome and log in to Facebook before retrying.');\n  }\n\n  if (payload.rows.length > 0) {\n    return payload.rows;\n  }\n\n  if (payload.status === 'empty') {\n    throw new EmptyResultError('facebook feed', 'Facebook did not show any feed posts for this account.');\n  }\n\n  const diagnostics = payload.diagnostics || {};\n  if (diagnostics.articleCount || diagnostics.actionMenuCount || diagnostics.fallbackActionCount || diagnostics.mainTextLength > 200) {\n    throw new CommandExecutionError(\n      'facebook feed page rendered but no feed rows could be extracted',\n      `Diagnostics: articles=${diagnostics.articleCount || 0}, actions=${diagnostics.fallbackActionCount || 0}, mainTextLength=${diagnostics.mainTextLength || 0}.`,\n    );\n  }\n","sourceCodeStart":354,"sourceCodeEnd":390,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/facebook/feed.js#L354-L390","documentation":"When the extraction payload reports status === 'auth', getFacebookFeed throws AuthRequiredError for www.facebook.com with the message 'Open Chrome and log in to Facebook before retrying.' The in-page script detected a login wall/checkpoint instead of the feed, so the library demands an authenticated browser session.","triggerScenarios":"Facebook served a login page, session-expired interstitial, or security checkpoint that the extraction script classified as status: 'auth'.","commonSituations":"Facebook session cookie expired; user logged out in the connected Chrome profile; Facebook forced a re-authentication or flagged the session; running against a fresh browser profile with no cookies.","solutions":["Open the connected Chrome instance and log in to Facebook manually, then re-run the command.","Verify the Chrome profile used by the extension has an active facebook.com session (visit facebook.com and confirm you see the feed).","Clear any pending checkpoint (2FA/identity confirmation) in the browser.","Re-authenticate via Facebook in the extension's profile rather than sharing cookies from another profile."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before calling, verify an authenticated session exists\nconst authed = await fetch('https://www.facebook.com', { credentials: 'include' })\n  .then(r => !/login/.test(r.url)).catch(() => false);\nif (!authed) throw new Error('Log in to Facebook in the connected browser first');","typeGuard":"function isAuthRequiredError(e) { return e instanceof Error && /log in to facebook/i.test(e.message); }","tryCatchPattern":"try {\n  const rows = await getFacebookFeed(page, { limit: 10 });\n} catch (err) {\n  if (/log in to Facebook/i.test(err.message)) {\n    // pause and prompt the operator to log into the connected Chrome\n  } else throw err;\n}","preventionTips":["Keep an active logged-in Facebook session in the extension's Chrome profile.","Handle Facebook checkpoints/2FA promptly.","Re-login before long-running automation sessions.","Verify facebook.com shows the feed manually after any session gap."],"tags":["auth","session","facebook"],"backgroundTag":"auth-session-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T17:17:51.833Z"}