{"record":{"id":"7057ecbd7608d5c8","repo":"jackwener/OpenCLI","slug":"linkedin-sent-invitations-requires-an-active-signe","errorCode":null,"errorMessage":"LinkedIn sent invitations requires an active signed-in browser session.","messagePattern":"LinkedIn sent invitations requires an active signed-in browser session\\.","errorType":"exception","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/linkedin/sent-invitations.js","lineNumber":96,"sourceCode":"}\n\ncli({\n  site: 'linkedin',\n  name: 'sent-invitations',\n  access: 'read',\n  description: 'List pending LinkedIn sent invitations for CRM reconciliation',\n  domain: LINKEDIN_DOMAIN,\n  strategy: Strategy.UI,\n  browser: true,\n  args: [],\n  columns: ['rank', 'name', 'profile_url', 'invited_date_text'],\n  func: async (page) => {\n    if (!page) throw new CommandExecutionError('Browser session required for linkedin sent-invitations');\n    await page.goto(SENT_URL);\n    await page.wait(12);\n    let result = unwrapEvaluateResult(await page.evaluate(buildSentInvitationsScript()));\n    if (result?.authRequired) {\n      throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn sent invitations requires an active signed-in browser session.');\n    }\n    if (result?.warning) {\n      throw new CommandExecutionError('LinkedIn warning/restriction state visible on sent invitations page.');\n    }\n    if (!result || typeof result !== 'object' || Array.isArray(result) || !Array.isArray(result.rows)) {\n      throw new CommandExecutionError('LinkedIn sent invitations returned a malformed extraction payload.');\n    }\n    if (result.malformedCount > 0) {\n      throw new CommandExecutionError('LinkedIn sent invitations contained a malformed invitation card.');\n    }\n    const rows = result.rows;\n    if (rows.length === 0) {\n      if (result.explicitEmpty) {\n        throw new EmptyResultError('linkedin sent-invitations', 'No pending sent invitations were found.');\n      }\n      throw new CommandExecutionError('LinkedIn sent invitation cards were not found; the page structure may have changed.');\n    }\n    return rows.map((row, index) => ({","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linkedin/sent-invitations.js#L78-L114","documentation":"After loading the LinkedIn invitation-manager page, the extraction script checks the body text and URL for sign-in/authwall markers. If result.authRequired is true, the command throws this AuthRequiredError because pending sent invitations are only visible to a signed-in account.","triggerScenarios":"Running `opencli linkedin sent-invitations` when the browser lands on a login, checkpoint, or authwall page instead of /mynetwork/invitation-manager/sent/ — body text matches /sign in|log in|join linkedin/ or the URL matches /linkedin.com\\/(login|checkpoint|authwall|uas)/.","commonSituations":"LinkedIn session expired or was logged out between runs; cookies cleared by automation; LinkedIn redirected to a security checkpoint; wrong browser profile without a LinkedIn login; account flagged and forced re-authentication.","solutions":["Open the automation browser profile, sign in to LinkedIn manually (complete any checkpoint/challenge), then re-run the command.","Verify you land on /mynetwork/invitation-manager/sent/ in that profile and can see invitations in the UI.","Keep the browser profile persistent so the session cookie survives across runs, and avoid clearing cookies.","If checkpoints recur, slow down usage frequency and avoid running from datacenter IPs that trigger LinkedIn security checks."],"exampleFix":"// before (expired session -> authwall redirect)\nawait page.goto('https://www.linkedin.com/mynetwork/invitation-manager/sent/');\n// after — verify sign-in state first\nawait page.goto('https://www.linkedin.com/feed/');\nif (/login|checkpoint|authwall/.test(page.url())) {\n  throw new Error('Sign in to LinkedIn in the automation browser before running sent-invitations');\n}","handlingStrategy":"validation","validationCode":"// Verify sign-in state before running the command\nawait page.goto('https://www.linkedin.com/feed/');\nconst url = page.url();\nif (/linkedin\\.com\\/(login|checkpoint|authwall|uas)/.test(url)) {\n  console.error('Not signed in: open the automation browser and complete LinkedIn sign-in first.');\n  process.exit(2);\n}","typeGuard":"const isAuthWall = ({ url = '', title = '', bodyText = '' }) =>\n  /linkedin\\.com\\/(login|checkpoint|authwall|uas)/.test(url) ||\n  /\\b(sign in|log in|join linkedin)\\b/i.test(`${title} ${bodyText}`);","tryCatchPattern":"try {\n  const rows = await run(['linkedin', 'sent-invitations']);\n} catch (e) {\n  if (e.name === 'AuthRequiredError' || /active signed-in browser session/.test(e.message)) {\n    console.error('LinkedIn session expired — sign in manually in the automation browser, then re-run.');\n    process.exit(2);\n  }\n  throw e;\n}","preventionTips":["Sign in to LinkedIn in the automation profile before scheduled runs; detect login pages proactively.","Use a persistent profile directory so JSESSIONID and related cookies survive restarts.","Handle any checkpoint/challenge promptly — an unanswered checkpoint eventually logs you out.","Avoid datacenter IPs and high request rates that push LinkedIn into forced re-authentication."],"tags":["linkedin","authentication","authwall","browser-session","scraping"],"backgroundTag":"authwall-session-expired","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}