jackwener/OpenCLI · error · CommandExecutionError

Upwork served a Cloudflare challenge page

Error message

Upwork served a Cloudflare challenge page

What it means

The feed probe checks whether the response is a Cloudflare interstitial: the document title contains 'just a moment' or elements with id starting 'cf-' exist. When detected, this CommandExecutionError is thrown because the CLI cannot (and should not try to) bypass the challenge. It means Cloudflare is bot-challenging the browser before Upwork's app even loads.

Source

Thrown at clis/upwork/feed.js:86

                return {
                    ready,
                    onLogin,
                    challenge,
                    jobsPresent: !!(state && Object.prototype.hasOwnProperty.call(state, 'jobs')),
                    jobs: state ? state.jobs : undefined,
                    paging: state && state.paging ? state.paging : null,
                };
            })()`));
        }
        catch (e) {
            throw new CommandExecutionError(`Failed to read Upwork feed state: ${e?.message ?? e}`, 'The Nuxt state global was not reachable; try again after opening Upwork in the connected browser.');
        }

        if (payload?.onLogin) {
            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');
        }
        if (payload?.challenge) {
            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');
        }
        if (!payload?.ready) {
            throw new CommandExecutionError(`Upwork feed state (window.__NUXT__.state.${stateKey}) was not present within 15s`, 'The page may not have finished hydrating, or the SSR state shape may have changed.');
        }
        if (!isPlainObject(payload)) {
            throw new CommandExecutionError('Upwork feed returned an unexpected Browser Bridge payload shape');
        }
        if (!payload.jobsPresent || !Array.isArray(payload.jobs)) {
            throw new CommandExecutionError(`Upwork feed state had an unexpected jobs shape; expected window.__NUXT__.state.${stateKey}.jobs to be an array.`);
        }

        const jobs = payload.jobs;
        if (jobs.length === 0) {
            throw new EmptyResultError(`upwork feed ${tab}`, `Upwork ${tab} feed is empty for the current account`);
        }

        const rows = jobsToListRows(jobs, { limit });
        if (rows.length === 0) {

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Open https://www.upwork.com in the connected browser and manually solve the Cloudflare challenge, then re-run the command.
  2. Reduce request frequency — add delays/backoff between feed calls instead of tight loops.
  3. Switch to a residential or less-flagged network (disable VPN, run from your normal machine).
  4. If challenges recur constantly, complete a full manual login so Cloudflare clearance cookies (cf_clearance) are stored in the browser profile.

Example fix

// before
setInterval(() => upwork.feed(), 1000);  // triggers Cloudflare challenge
// after
async function pollFeed() {
  const jobs = await upwork.feed();
  setTimeout(pollFeed, 60_000); // rate-limit polling
}
Defensive patterns

Strategy: retry

Try / catch

try {
  const jobs = await upwork.feed();
} catch (e) {
  if (/Cloudflare challenge/.test(e.message)) {
    console.error('Solve the challenge at upwork.com in the browser, then rerun.');
    // optional: long backoff before auto-retry
    await sleep(60_000);
    return feedWithBackoff();
  }
  throw e;
}

Prevention

When it happens

Trigger: Running `upwork feed` while Cloudflare serves a 'Just a moment…' challenge page — typically due to suspicious traffic patterns from the browser's IP (datacenter/VPN IP), high request frequency from scripted usage, or a stricter Cloudflare security level on Upwork.

Common situations: Running the CLI from a cloud server or VPN with a flagged IP; hammering the feed in a tight loop; Upwork raising its Cloudflare sensitivity during attack mitigation; residential IP recently blacklisted.

Related errors


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