{"record":{"id":"0dc4f66b4a78f84b","repo":"jackwener/OpenCLI","slug":"upwork-served-a-cloudflare-challenge-page-0dc4f6","errorCode":null,"errorMessage":"Upwork served a Cloudflare challenge page","messagePattern":"Upwork served a Cloudflare challenge page","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/upwork/feed.js","lineNumber":86,"sourceCode":"                return {\n                    ready,\n                    onLogin,\n                    challenge,\n                    jobsPresent: !!(state && Object.prototype.hasOwnProperty.call(state, 'jobs')),\n                    jobs: state ? state.jobs : undefined,\n                    paging: state && state.paging ? state.paging : null,\n                };\n            })()`));\n        }\n        catch (e) {\n            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.');\n        }\n\n        if (payload?.onLogin) {\n            throw new AuthRequiredError('upwork.com', 'Upwork redirected to login. Open https://www.upwork.com in the connected browser and sign in, then retry.');\n        }\n        if (payload?.challenge) {\n            throw new CommandExecutionError('Upwork served a Cloudflare challenge page', 'Open https://www.upwork.com in the connected browser and clear the challenge, then retry.');\n        }\n        if (!payload?.ready) {\n            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.');\n        }\n        if (!isPlainObject(payload)) {\n            throw new CommandExecutionError('Upwork feed returned an unexpected Browser Bridge payload shape');\n        }\n        if (!payload.jobsPresent || !Array.isArray(payload.jobs)) {\n            throw new CommandExecutionError(`Upwork feed state had an unexpected jobs shape; expected window.__NUXT__.state.${stateKey}.jobs to be an array.`);\n        }\n\n        const jobs = payload.jobs;\n        if (jobs.length === 0) {\n            throw new EmptyResultError(`upwork feed ${tab}`, `Upwork ${tab} feed is empty for the current account`);\n        }\n\n        const rows = jobsToListRows(jobs, { limit });\n        if (rows.length === 0) {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/upwork/feed.js#L68-L104","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Open https://www.upwork.com in the connected browser and manually solve the Cloudflare challenge, then re-run the command.","Reduce request frequency — add delays/backoff between feed calls instead of tight loops.","Switch to a residential or less-flagged network (disable VPN, run from your normal machine).","If challenges recur constantly, complete a full manual login so Cloudflare clearance cookies (cf_clearance) are stored in the browser profile."],"exampleFix":"// before\nsetInterval(() => upwork.feed(), 1000);  // triggers Cloudflare challenge\n// after\nasync function pollFeed() {\n  const jobs = await upwork.feed();\n  setTimeout(pollFeed, 60_000); // rate-limit polling\n}","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const jobs = await upwork.feed();\n} catch (e) {\n  if (/Cloudflare challenge/.test(e.message)) {\n    console.error('Solve the challenge at upwork.com in the browser, then rerun.');\n    // optional: long backoff before auto-retry\n    await sleep(60_000);\n    return feedWithBackoff();\n  }\n  throw e;\n}","preventionTips":["Rate-limit calls (e.g. one feed poll per minute, not per second).","Avoid datacenter/VPN IPs; run from a residential connection.","Solve the challenge manually once so cf_clearance cookies persist in the profile.","Add exponential backoff after any challenge instead of hammering retries."],"tags":["upwork","cloudflare","bot-detection","rate-limiting","browser-automation"],"backgroundTag":"cloudflare-challenge","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}