{"record":{"id":"961bbb16991d45af","repo":"jackwener/OpenCLI","slug":"suno-whoami-failed-probe-detail","errorCode":null,"errorMessage":"Suno whoami failed: ${probe.detail}","messagePattern":"Suno whoami failed: (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/suno/auth.js","lineNumber":45,"sourceCode":"      if (!r.ok) return { kind: 'http', httpStatus: r.status };\n      const d = await r.json();\n      const sessions = d?.response?.sessions || [];\n      if (!Array.isArray(sessions) || sessions.length === 0) {\n        return { kind: 'auth', detail: 'clerk.suno.com sessions=[] — anonymous' };\n      }\n      const active = sessions.find(s => s.status === 'active') || sessions[0];\n      const user = active?.user;\n      if (!user?.id) {\n        return { kind: 'auth', detail: 'clerk.suno.com session present but no user.id — stale session' };\n      }\n      return { ok: true, user_id: String(user.id), name: String(user.username || '') };\n    } catch (e) {\n      return { kind: 'exception', detail: String(e && e.message || e) };\n    }\n  })()`);\n  if (probe?.kind === 'auth') throw new AuthRequiredError('suno.com', probe.detail);\n  if (probe?.kind === 'http') throw new CommandExecutionError(`HTTP ${probe.httpStatus} from clerk.suno.com`);\n  if (probe?.kind === 'exception') throw new CommandExecutionError(`Suno whoami failed: ${probe.detail}`);\n  if (!probe?.ok) throw new CommandExecutionError(`Unexpected Suno probe: ${JSON.stringify(probe)}`);\n  return { user_id: probe.user_id, name: probe.name };\n}\n\nregisterSiteAuthCommands({\n  site: 'suno',\n  domain: 'suno.com',\n  loginUrl: 'https://suno.com/?sign-in=true',\n  columns: ['user_id', 'name'],\n  quickCheck: hasSunoClerkCookie,\n  verify: verifySunoIdentity,\n  poll: async (page) => {\n    if (!await hasSunoClerkCookie(page)) {\n      throw new AuthRequiredError('suno.com', 'Waiting for Suno Clerk __session/__client cookie');\n    }\n    return verifySunoIdentity(page);\n  },\n});","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/auth.js#L27-L63","documentation":"The in-page fetch to clerk.suno.com/v1/client threw a JS exception (network error, Clerk SDK/global problem, CORS, etc.); the probe caught it and verifySunoIdentity surfaces it as `Suno whoami failed: <detail>`. The library deliberately converts page-side exceptions into a CommandExecutionError carrying the original message.","triggerScenarios":"window fetch throws inside page.evaluate during verifySunoIdentity — e.g. `window.Clerk` missing so a later probe step fails, network fetch aborted, TLS error, or page navigated/closed mid-probe.","commonSituations":"Flaky connectivity mid-probe; automation page closed or navigated by another tab; browser blocking third-party requests to clerk.suno.com; extensions or privacy settings killing the request.","solutions":["Read the `detail` suffix in the message — it contains the underlying exception","Retry the command; transient network errors resolve themselves","Re-open the suno login/session so the page context is healthy and window.Clerk is initialized","Check browser settings/extensions that block clerk.suno.com requests"],"exampleFix":"// before\nSuno whoami failed: Failed to fetch\n// after — ensure page is on suno.com and Clerk is ready before probing\nawait page.goto('https://suno.com/');\nawait page.waitForFunction(() => !!window.Clerk);\nawait verifySunoIdentity(page);","handlingStrategy":"retry","validationCode":"// Ensure the page is on suno.com and Clerk is initialized before any suno command\nawait page.goto('https://suno.com/');\nawait page.waitForFunction(() => !!window.Clerk);","typeGuard":"function looksLikeNetworkFailure(detail) {\n  return /Failed to fetch|NetworkError|aborted/i.test(String(detail));\n}","tryCatchPattern":"try {\n  await cli('suno', 'whoami');\n} catch (e) {\n  if (/Suno whoami failed:/.test(e.message) && looksLikeNetworkFailure(e.message)) {\n    await sleep(2000); return cli('suno', 'whoami'); // transient network error\n  }\n  throw e;\n}","preventionTips":["Keep the automation browser page open and on suno.com for the whole command","Retry transient network failures with backoff","Disable extensions/privacy settings that block clerk.suno.com","Check connectivity before long automated suno runs"],"tags":["network","browser","clerk","suno"],"backgroundTag":"fetch-failed-in-page","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}