jackwener/OpenCLI · error · CommandExecutionError
Suno session check failed (${detail}).
Error message
Suno session check failed (${detail}). What it means
ensureSunoSession throws this generic CommandExecutionError when the session pre-flight fails for a non-auth reason: the in-page check returned ok:false without a 401/403 or auth flag. `detail` carries the status or error string returned by the browser-side fetch.
Source
Thrown at clis/suno/utils.js:209
let data = null;
try {
data = await res.json();
} catch (e) {
return { ok: false, error: 'Malformed billing/info JSON: ' + String(e).slice(0, 200) };
}
const parse = ${parseSunoBillingInfo.toString()};
return { ok: true, ...parse(data) };
} catch (e) {
return { ok: false, error: String(e).slice(0, 200) };
}
})()`));
if (!result || !result.ok) {
const detail = result?.status || result?.error || 'unknown';
if (result?.auth || result?.status === 401 || result?.status === 403) {
throw new AuthRequiredError(SUNO_DOMAIN, `Suno session check failed (${detail}). Open https://suno.com in Chrome and sign in, then retry.`);
}
throw new CommandExecutionError(`Suno session check failed (${detail}).`);
}
return { ...result, deviceId };
}
/**
* Verify the captcha pre-flight. If `required:true`, the simple flow won't
* work without solving a CAPTCHA (out of scope for the headless adapter).
*/
export async function checkSunoCaptcha(page, deviceId) {
const result = unwrapEvaluateResult(await page.evaluate(`(async () => {
const res = await fetch('${STUDIO_API}/api/c/check', {
method: 'POST',
headers: ${sunoHeadersJs(deviceId, { 'Content-Type': 'application/json' })},
body: JSON.stringify({ ctype: 'generation' }),
});
if (!res.ok) return { ok: false, status: res.status };
return { ok: true, ...(await res.json()) };
})()`));View on GitHub (pinned to 49907e53dc)
Solutions
- Retry the command after a short wait — transient network or 5xx/429 conditions often clear.
- Open https://suno.com in the controlled Chrome tab and complete any captcha/Cloudflare challenge so the real app (and window.Clerk) loads.
- Check network/proxy connectivity to suno.com and studio-api-prod.suno.com.
- Verify the browser page loaded suno.com fully (no error page); reload the tab and retry.
- If detail shows 429, slow down — wait for the rate-limit window before retrying.
Example fix
// before (running while a Cloudflare challenge page is loaded) opencli suno status // -> Suno session check failed (malformed clips payload). // after (complete the challenge / reload the app page in Chrome, then) opencli suno status
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight: check network reachability and a fully-loaded suno.com app
const reachable = await fetch('https://suno.com', { method: 'HEAD' }).then(r => r.ok).catch(() => false);
if (!reachable) throw new Error('suno.com unreachable — check network/proxy'); Type guard
function isTransientSessionFailure(err) {
return err && !/sign in/i.test(err.message || '') && /session check failed/i.test(err.message || '');
} Try / catch
for (let attempt = 1; attempt <= 3; attempt++) {
try { await ensureSunoSession(page, deviceId); break; }
catch (err) {
if (err.name === 'AuthRequiredError') throw err; // not transient
if (attempt === 3) throw err;
await new Promise(r => setTimeout(r, attempt * 2000));
}
} Prevention
- Retry with backoff for 429/5xx/non-auth failures.
- Complete any Cloudflare/captcha challenge in the browser tab before running commands.
- Check proxy/firewall access to suno.com and studio-api-prod.suno.com.
- Reload the suno.com tab if window.Clerk is missing.
When it happens
Trigger: The browser-side fetch to suno.com fails due to network errors, a non-auth HTTP status (429, 5xx), Cloudflare/anti-bot interstitials, or a page context error (Clerk object missing because the page didn't load correctly) — any failure that isn't clearly an auth rejection.
Common situations: Offline or flaky network; suno.com partially down or rate-limiting (HTTP 429); a captcha/Cloudflare challenge page replacing the app so `window.Clerk` is undefined; corporate proxy blocking studio-api requests.
Related errors
- Barchart greeks request failed: ${data.message || 'unknown e
- Failed to load Booking.com search page: ${err?.message || er
- ChatGPT did not create a conversation URL after sending the
- Failed to open Chess.com analysis board: ${error?.message ||
- Failed to send message
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/c577b4b648a821ab.
Report an issue: GitHub.