jackwener/OpenCLI · error · CommandExecutionError

LinkedIn people search navigation failed: ${error?.message |

Error message

LinkedIn people search navigation failed: ${error?.message || error}

What it means

After building the LinkedIn people-search URL, the command navigates with page.goto and waits ~6 seconds for the page to settle. Any navigation error (network failure, timeout, DNS error, ERR_ABORTED, redirect loop) is caught and rethrown as CommandExecutionError prefixed with 'LinkedIn people search navigation failed:'.

Source

Thrown at clis/linkedin/people-search.js:199

    description: 'Search standard LinkedIn (not Sales Navigator) for people by keyword. Each invocation consumes against LinkedIn\'s monthly Commercial Use Limit on people search; throttle accordingly.',
    domain: LINKEDIN_DOMAIN,
    strategy: Strategy.COOKIE,
    browser: true,
    args: [
        { name: 'keywords', type: 'string', required: true, positional: true, help: 'People search keywords, e.g. "site reliability engineer berlin"' },
        { name: 'limit', type: 'int', default: 5, help: `Maximum people to return (1-${MAX_LIMIT}); each query counts toward LinkedIn's monthly CUL` },
    ],
    columns: ['rank', 'name', 'headline', 'location', 'profile_url'],
    func: async (page, args) => {
        if (!page) throw new CommandExecutionError('Browser session required for linkedin people-search');
        const keywords = requireStringArg(args, 'keywords', '--keywords');
        const limit = parseLimit(args.limit);

        try {
            await page.goto(buildSearchUrl(keywords));
            await page.wait(6);
        } catch (error) {
            throw new CommandExecutionError(`LinkedIn people search navigation failed: ${error?.message || error}`);
        }

        let cookies;
        try {
            cookies = await page.getCookies({ url: 'https://www.linkedin.com' });
        } catch (error) {
            throw new CommandExecutionError(`LinkedIn cookie lookup failed: ${error?.message || error}`);
        }
        if (!Array.isArray(cookies)) {
            throw new CommandExecutionError('LinkedIn cookie lookup returned malformed payload');
        }
        const jsession = cookies.find((c) => c.name === 'JSESSIONID')?.value;
        if (!jsession) {
            throw new AuthRequiredError(LINKEDIN_DOMAIN, 'LinkedIn JSESSIONID cookie not found. Please sign in to LinkedIn in the browser.');
        }

        let result;
        try {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check network connectivity / proxy settings and retry
  2. Increase the navigation timeout in the underlying page.goto wrapper if on a slow connection
  3. Sanitize/quote the keywords argument so the search URL is well-formed
  4. Retry later — LinkedIn may be rate-limiting or temporarily blocking your IP
  5. Catch CommandExecutionError and surface error.message for the underlying cause

Example fix

// before: raw keywords break URL
await cli('linkedin people-search', { keywords: 'sre "berlin" & more' });
// after: sanitized keywords
await cli('linkedin people-search', { keywords: 'sre berlin more' });
Defensive patterns

Strategy: retry

Validate before calling

const keywords = String(args.keywords || '').trim();
if (!keywords || /[^\p{L}\p{N}\s'"-]/u.test(keywords)) throw new Error('keywords must be plain text for the search URL');
if (typeof navigator !== 'undefined' && !navigator.onLine) throw new Error('offline: navigation would fail');

Type guard

null

Try / catch

try { await gotoWithRetry(page, buildSearchUrl(keywords), 2); }
catch (e) { if (isTransientNavError(e)) await sleep(5000); else throw e; }

Prevention

When it happens

Trigger: page.goto(buildSearchUrl(keywords)) or page.wait(6) throws — network outage, navigation timeout, LinkedIn blocking/timing out the request, invalid characters in keywords producing a bad URL, or the browser tab closing mid-navigation.

Common situations: No internet/VPN/DNS issues; corporate proxy blocking linkedin.com; slow connection exceeding the goto timeout; LinkedIn throttling or resetting the connection; keywords containing characters that break the URL encoding.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/8b6840c0ce029749. Report an issue: GitHub.