jackwener/OpenCLI · error · CommandExecutionError

Suno feed lookup failed (HTTP ${result?.status || '?'}).

Error message

Suno feed lookup failed (HTTP ${result?.status || '?'}).

What it means

`opencli suno list` fetches the /api/feed/v2 feed inside the browser page. If the result is not ok and carries no specific error, the CLI throws with the HTTP status (or '?'). This covers non-2xx responses and any other failed fetch outcome.

Source

Thrown at clis/suno/list.js:56

        const deviceId = session.deviceId;

        const result = unwrapEvaluateResult(await page.evaluate(`(async () => {
            const browserToken = JSON.stringify({ token: btoa(JSON.stringify({ timestamp: Date.now() })) });
            const res = await fetch('${STUDIO_API}/api/feed/v2?page=${pageOffset}', {
                headers: {
                    'Authorization': 'Bearer ' + (await window.Clerk.session.getToken()),
                    'browser-token': browserToken,
                    'device-id': ${JSON.stringify(deviceId)},
                },
            });
            if (!res.ok) return { ok: false, status: res.status };
            const data = await res.json().catch(() => null);
            if (!data || !Array.isArray(data.clips)) return { ok: false, error: 'malformed clips payload' };
            return { ok: true, clips: data.clips };
        })()`));

        if (!result?.ok) {
            throw new CommandExecutionError(result?.error || `Suno feed lookup failed (HTTP ${result?.status || '?'}).`);
        }
        if (!Array.isArray(result.clips)) {
            throw new CommandExecutionError('Suno feed lookup returned malformed clips payload');
        }
        if (result.clips.length === 0) {
            throw new EmptyResultError('suno list', 'No Suno clips found in your library.');
        }

        return result.clips.slice(0, limit).map((c, i) => {
            if (!c || typeof c.id !== 'string' || !c.id) {
                throw new CommandExecutionError('Suno feed lookup returned malformed clip identity');
            }
            return {
                rank: i + 1 + pageOffset * limit,
                clip: c.id.slice(0, 8),
                title: c.title || '(untitled)',
                status: c.status || '?',
                created: (c.created_at || '').replace('T', ' ').replace(/\..*$/, '').replace(/Z$/, ''),

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Check the HTTP status in the message: 401/403 → re-login to Suno to refresh cookies; 429 → back off and retry later; 5xx → wait for Suno.
  2. Run any read command after re-authenticating in the browser profile the CLI uses.
  3. Retry with exponential backoff for transient 429/5xx.
  4. Verify suno.com is reachable and not under an incident.

Example fix

// before: hammering the feed in a loop
for (const p of pages) await opencli('suno', 'list', '--page', p);
// after: backoff on failure
await withRetry(() => opencli('suno', 'list', '--page', p), { retries: 3, delayMs: 2000 });
Defensive patterns

Strategy: retry

Validate before calling

// Refresh auth and confirm reachability before listing:
await ensureSunoSession(page); // throws early if cookies are dead
if (sessionInvalid) await reloginSuno();

Type guard

function isFeedOk(r) { return !!r && r.ok === true && Array.isArray(r.clips); }

Try / catch

try {
  const clips = await opencli('suno', 'list', '--limit', '20');
} catch (e) {
  const m = /HTTP (\d+)/.exec(e.message);
  const status = m && Number(m[1]);
  if (status === 401 || status === 403) await reloginSuno();
  else if (status === 429) await sleep(exponentialBackoff());
  else if (!status) throw new Error('Suno unreachable — check network');
  throw e;
}

Prevention

When it happens

Trigger: The in-page fetch to `${STUDIO_API}/api/feed/v2?page=N` returns res.ok === false (401/403 expired Clerk session, 429 rate limit, 5xx outage), producing `{ok:false, status}`.

Common situations: Stale/expired Suno cookies, IP rate limiting from frequent polling, Suno API outage, or navigating before the Clerk session token is available.

Related errors


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