{"record":{"id":"6152353d51e999fa","repo":"jackwener/OpenCLI","slug":"linkedin-people-search-requires-an-active-signed-i","errorCode":null,"errorMessage":"LinkedIn people search requires an active signed-in browser session.","messagePattern":"LinkedIn people search requires an active signed-in browser session\\.","errorType":"error_code","errorClass":"AuthRequiredError","httpStatus":null,"severity":"error","filePath":"clis/linkedin/people-search.js","lineNumber":224,"sourceCode":"            throw new CommandExecutionError(`LinkedIn cookie lookup failed: ${error?.message || error}`);\n        }\n        if (!Array.isArray(cookies)) {\n            throw new CommandExecutionError('LinkedIn cookie lookup returned malformed payload');\n        }\n        const jsession = cookies.find((c) => c.name === 'JSESSIONID')?.value;\n        if (!jsession) {\n            throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn in the browser.');\n        }\n\n        let result;\n        try {\n            result = unwrapEvaluateResult(await page.evaluate(extractionScript()));\n        } catch (error) {\n            throw new CommandExecutionError(`LinkedIn people search extraction failed: ${error?.message || error}`);\n        }\n        if (result?.error) {\n            if (looksLinkedInAuthWall(`${result.url || ''} ${result.error || ''}`)) {\n                throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn people search requires an active signed-in browser session.');\n            }\n            // If LinkedIn redirected away from the search page that\n            // usually means CUL was reached or the account is gated.\n            throw new CommandExecutionError(`LinkedIn redirected away from the search page (${result.error}). Likely Commercial Use Limit reached - the limit resets on the 1st of next month.`);\n        }\n        if (!result || typeof result !== 'object') {\n            throw new CommandExecutionError('LinkedIn people search returned malformed extraction payload');\n        }\n        const candidateCount = parseNonNegativeCount(result.candidate_count, 'candidate_count');\n        parseNonNegativeCount(result.person_entries_count, 'person_entries_count');\n        const resolvedCount = parseNonNegativeCount(result.resolved_count, 'resolved_count');\n        const rows = normalizePeopleRows(result.rows);\n        if (rows.length === 0 && (candidateCount > 0 || resolvedCount > 0)) {\n            throw new CommandExecutionError('LinkedIn people search found profile candidates but could not parse stable result rows');\n        }\n        if (rows.length === 0) {\n            throw new EmptyResultError(`No people found on the rendered page for \"${keywords}\". The search may have returned zero results, or the DOM markup may have changed.`);\n        }","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/linkedin/people-search.js#L206-L242","documentation":"When the extraction script reports result.error, the command checks the URL and error text with looksLinkedInAuthWall. If they look like LinkedIn's login/auth wall, it throws AuthRequiredError: the search results can only be viewed by a signed-in member, so the run must stop and the user must authenticate.","triggerScenarios":"result.error set and result.url/error text matches LinkedIn auth-wall patterns — e.g. LinkedIn redirected the search to /login or an authwall subdomain because the browser session is not signed in.","commonSituations":"Running search against a never-signed-in browser profile; JSESSIONID present but session invalidated server-side; LinkedIn forcing re-auth after suspicious activity; using a region/IP that LinkedIn gates behind login.","solutions":["Sign in to LinkedIn in the controlled browser, then re-run the search","Refresh an expired session (log out and back in) to clear server-side invalidation","Avoid rapid repeated searches that trigger LinkedIn's anti-bot re-auth","Catch AuthRequiredError and route the user to an interactive login flow"],"exampleFix":"// before\nawait cli('linkedin people-search', { keywords: 'sre berlin' });\n// after\nawait cli('browser open'); // complete LinkedIn login in the opened tab\nawait cli('linkedin people-search', { keywords: 'sre berlin' });","handlingStrategy":"try-catch","validationCode":"// preflight: confirm a signed-in session before searching\nconst cookies = await page.getCookies({ url: 'https://www.linkedin.com' });\nif (!cookies.some((c) => c.name === 'JSESSIONID' && c.value)) throw new Error('Sign in to LinkedIn before running people-search');","typeGuard":"null","tryCatchPattern":"try { await cli('linkedin people-search', args); }\ncatch (e) { if (e.name === 'AuthRequiredError' || /signed-in browser session/.test(e.message)) { await interactiveLinkedInLogin(); return retryOnce(); } throw e; }","preventionTips":["Maintain a logged-in browser profile for scraping runs","Avoid aggressive search loops that trigger LinkedIn's re-auth","Detect authwall redirects early in your own wrappers","Refresh sessions periodically during long-running batch jobs"],"tags":["authentication","linkedin","authwall","scraping"],"backgroundTag":"linkedin-authwall","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}