{"record":{"id":"cb2098ab802d7cd9","repo":"jackwener/OpenCLI","slug":"suno-download-wrote-no-files-for-clip-clipid","errorCode":null,"errorMessage":"Suno download wrote no files for clip ${clipId}","messagePattern":"Suno download wrote no files for clip (.+?)","errorType":"exception","errorClass":"CommandExecutionError","httpStatus":null,"severity":"error","filePath":"clis/suno/download.js","lineNumber":120,"sourceCode":"        })()`));\n\n        if (!feedRes?.ok) {\n            throw new CommandExecutionError(`Suno feed lookup failed: ${feedRes?.error || 'unknown'}`);\n        }\n        if (!Array.isArray(feedRes.clips)) {\n            throw new CommandExecutionError('Suno feed lookup returned malformed clips payload');\n        }\n        const clip = feedRes.clips.find(c => c.id === clipId);\n        if (!clip) {\n            throw new EmptyResultError('suno download', `Clip ${clipId} not found in your account. Confirm at ${SUNO_URL}/song/${clipId}.`);\n        }\n        if (clip.status !== 'complete') {\n            throw new CommandExecutionError(`Clip ${clipId} status is \"${clip.status}\" — not complete yet. Retry once generation finishes.`);\n        }\n\n        const result = await downloadSunoClip(page, clip, outputDir, formats, deviceId);\n        if (!result.written.some(w => w.ok)) {\n            throw new CommandExecutionError(`Suno download wrote no files for clip ${clipId}`);\n        }\n        const link = `${SUNO_URL}/song/${clip.id}`;\n        const writtenSummary = result.written\n            .map(w => w.ok ? `${w.format}:${displayPath(w.file)}` : `${w.format}:✗(${w.reason})`)\n            .join(' | ');\n        const skippedSummary = skippedPaid.length\n            ? ` | skipped(needs --confirm-paid):${skippedPaid.join(',')}`\n            : '';\n        const fileSummary = `${writtenSummary}${skippedSummary}`;\n        const anyFailed = result.written.some(w => !w.ok);\n\n        return [{\n            status: anyFailed ? '⚠ partial' : '✅ saved',\n            clip: clip.id.slice(0, 8),\n            title: clip.title || '(untitled)',\n            files: `📁 ${fileSummary}`,\n            link: `🔗 ${link}`,\n        }];","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/clis/suno/download.js#L102-L138","documentation":"Thrown by `opencli suno download` after `downloadSunoClip` runs when every requested format write failed (`result.written` has no entry with `ok: true`). The clip was found and complete, but the browser-driven download pipeline produced zero files on disk. Per-write failure reasons are printed in the run summary (`format:✗(reason)`).","triggerScenarios":"Requesting formats (mp3/wav/m4a/video/cover/metadata) where every one failed — e.g. download URLs returned errors, browser save events never fired, the output directory is not writable, or paid formats (wav) were rejected without billing consent.","commonSituations":"Unwritable or nonexistent --op output directory, disk full, Suno CDN download URL expiring or 403-ing, popup/download interception blocked in the driven Chrome profile, or network drop mid-download.","solutions":["Retry the command and read the per-format failure reasons in the summary line; fix the specific reason shown.","Verify the output directory (--op, default ~/Music/suno) exists and is writable, and that you have free disk space.","Confirm the driven Chrome profile allows downloads and isn't blocking popups/multiple downloads.","Narrow to a single free format (`--formats mp3`) to isolate whether the failure is format-specific (e.g. CDN or billing) or systemic."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import fs from 'node:fs';\n// before running: ensure the output dir exists and is writable, and disk has space\nconst outDir = '/home/me/Music/suno';\nfs.mkdirSync(outDir, { recursive: true });\nfs.accessSync(outDir, fs.constants.W_OK);","typeGuard":null,"tryCatchPattern":"try {\n  await run(`opencli suno download ${clipId} --formats mp3,metadata`);\n} catch (err) {\n  if (String(err.message).includes('wrote no files')) {\n    // inspect per-format ✗(reason) summary; fix dir permissions/CDN issue and retry\n  } else throw err;\n}","preventionTips":["Pre-create the --op output directory and verify write permissions before running.","Keep the driven Chrome profile configured to allow downloads (no blocking of multiple downloads).","Start with a free format (mp3) to isolate paid/CDN-specific failures.","Retry once on network-related failures before escalating."],"tags":["suno","download-failed","filesystem","browser-automation"],"backgroundTag":"download-failed","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}