{"record":{"id":"a00c0138b98a4716","repo":"jackwener/OpenCLI","slug":"suno-captcha-pre-flight-failed-captcha-status","errorCode":null,"errorMessage":"Suno captcha pre-flight failed${captcha?.status ? ` (HTTP ${captcha.status})` : ''}.","messagePattern":"Suno captcha pre-flight failed(.+?)\\)` : ''\\}\\.","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/suno/generate.js","lineNumber":131,"sourceCode":"        const timeout = requirePositiveInt(kwargs.timeout, '--timeout');\n        const makeInstrumental = normalizeBooleanFlag(kwargs.instrumental);\n        const weirdness = clampSlider(kwargs.weirdness, '--weirdness', 0.5);\n        const styleWeight = clampSlider(kwargs['style-weight'], '--style-weight', 0.5);\n\n        // Title: required by API. Auto-derive from first 60 chars of source prompt if not provided.\n        const titleSource = titleArg || (isCustom ? (tags || lyrics.split('\\n')[0]) : description);\n        const title = titleSource.replace(/\\s+/g, ' ').trim().slice(0, 60) || 'Untitled';\n\n        const session = await ensureSunoSession(page);\n        if (!session.planId) {\n            throw new CommandExecutionError(\n                `Suno generation needs a resolved plan id for the user_tier field, but billing/info did not surface one for this account (subscription_type=${session.planKey}). Verify the account is active at ${SUNO_URL}/account, then retry.`,\n            );\n        }\n        const deviceId = session.deviceId;\n        const captcha = await checkSunoCaptcha(page, deviceId);\n        if (!captcha?.ok) {\n            throw new CommandExecutionError(\n                `Suno captcha pre-flight failed${captcha?.status ? ` (HTTP ${captcha.status})` : ''}.`,\n                `Open ${SUNO_URL}/create in Chrome and verify the account is ready, then retry.`,\n            );\n        }\n        if (captcha?.required) {\n            throw new CommandExecutionError(\n                'Suno requires a CAPTCHA challenge for this account/IP right now.',\n                `Open ${SUNO_URL}/create in Chrome, solve a Create challenge once, then retry.`,\n            );\n        }\n        if (session.totalCreditsAvailable < 10) {\n            const b = session.breakdown;\n            throw new CommandExecutionError(\n                `Suno generation needs ~10 credits; you have ${session.totalCreditsAvailable} (monthly ${b.monthlyRemaining}/${b.monthlyLimit} + packs ${b.purchasedPacks} + leftover ${b.pack}). Top up at ${SUNO_URL}/account.`,\n            );\n        }\n\n        const transactionUuid = crypto.randomUUID();","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/generate.js#L113-L149","documentation":"A CommandExecutionError from the CAPTCHA pre-flight in `opencli suno generate`: `checkSunoCaptcha(page, deviceId)` did not return ok — either the pre-flight check request failed (the message appends ` (HTTP <status>)` when a status is known) or the response was unusable. It runs before submission so Suno's anti-bot gate is detected early, with remediation guidance as the second argument.","triggerScenarios":"Running `opencli suno generate` when the captcha pre-flight endpoint returns a non-2xx (e.g. 403/429 from IP reputation or rate limiting), the session/deviceId is stale so the check errors, or Cloudflare/anti-bot interstitials intercept the in-page request.","commonSituations":"Generating from a VPN/datacenter IP flagged by Suno, hitting the endpoint too frequently, stale persistent cookie sessions after long idle, or Suno tightening bot protection after an incident.","solutions":["Open https://suno.com/create in the driven Chrome profile and verify the account loads normally, then retry the command.","Disable VPN / switch to a residential network if your IP is flagged (HTTP 403/429 in the message points at this).","Refresh the Suno session (re-login in the Chrome profile) so deviceId/cookies are current, then retry.","If a challenge appears in the browser, solve one Create CAPTCHA manually — a subsequent required-captcha error will say so explicitly — then rerun."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// sanity-check connectivity to suno.com and avoid flagged IPs before generating\nconst res = await fetch('https://suno.com/create', { method: 'HEAD' });\nif (!res.ok && res.status !== 200) {\n  console.warn('suno.com may be gating this IP — disable VPN / change network before running');\n}","typeGuard":null,"tryCatchPattern":"try {\n  await run('opencli suno generate \"...\"');\n} catch (err) {\n  if (String(err.message).startsWith('Suno captcha pre-flight failed')) {\n    // open suno.com/create in the driven Chrome, confirm access (solve a\n    // challenge if shown), drop VPN if HTTP 403/429, then retry\n  } else throw err;\n}","preventionTips":["Avoid VPNs/datacenter IPs when driving Suno — they frequently trip anti-bot checks.","Keep the persistent session warm by opening suno.com periodically instead of after long idle.","Space out generate calls to avoid rate-limit-induced 429s.","Solve any Create CAPTCHA manually in the driven browser once; the CLI will then proceed."],"tags":["suno","captcha","anti-bot","network"],"backgroundTag":"captcha-challenge-required","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}