jackwener/OpenCLI · error · CommandExecutionError
MiniMax music failed (service ${base.status_code}${message})
Error message
MiniMax music failed (service ${base.status_code}${message}) What it means
A CommandExecutionError thrown by parseCompletedMusic() when base_resp.status_code is a non-zero, non-auth code — i.e. MiniMax's service rejected the generation request for a domain reason (invalid parameters, content policy, model unavailable). The optional status_msg from MiniMax is appended after the code.
Source
Thrown at clis/minimax/utils.js:97
}
}
export function parseCompletedMusic(payload, region) {
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
throw new CommandExecutionError('MiniMax music returned a malformed response envelope');
}
const base = payload.base_resp;
if (!base || typeof base !== 'object' || !Number.isInteger(base.status_code)) {
throw new CommandExecutionError('MiniMax music response is missing integer base_resp.status_code');
}
if (base.status_code !== 0) {
const message = typeof base.status_msg === 'string' && base.status_msg.trim()
? `: ${base.status_msg.trim()}`
: '';
if (AUTH_CODES.has(base.status_code)) {
throw new AuthRequiredError(region.host, `MiniMax ${region.host} rejected ${MINIMAX_API_KEY_VAR} (service ${base.status_code}${message}).`);
}
throw new CommandExecutionError(`MiniMax music failed (service ${base.status_code}${message})`);
}
const data = payload.data;
if (!data || typeof data !== 'object' || Array.isArray(data) || !Number.isInteger(data.status)) {
throw new CommandExecutionError('MiniMax music response is missing integer data.status');
}
if (data.status === 1) {
const traceId = typeof payload.trace_id === 'string' && /^[A-Za-z0-9_-]{1,128}$/.test(payload.trace_id.trim())
? payload.trace_id.trim()
: '';
throw new CommandExecutionError(
`MiniMax music returned status 1 (in progress) without a resumable task id${traceId ? ` (trace_id: ${traceId})` : ''}`,
'Do not resubmit blindly: this endpoint exposes no query command, so check MiniMax account history first.',
);
}
if (data.status !== 2) {
throw new CommandExecutionError(`MiniMax music returned unknown data.status ${data.status}`);
}
if (typeof data.audio !== 'string' || !data.audio.trim()) {View on GitHub (pinned to 49907e53dc)
Solutions
- Read the appended status_msg (after the code) and look it up in MiniMax's base_resp status code documentation.
- Simplify or reword the prompt/lyrics to rule out content-moderation rejections.
- Validate model and audio_setting parameters against current MiniMax music_generation docs.
- If the code indicates a transient/capacity issue, wait and retry; check account history first to avoid duplicate billing.
Example fix
// before (moderation refusal on service 2013) minimax music --lyrics "<policy-violating text>" // after minimax music --lyrics "clean, original lyrics" --model music-01
Defensive patterns
Strategy: try-catch
Validate before calling
// validate inputs likely to trigger service rejections before submitting
if (!options.prompt && !options.lyrics) throw new Error('Provide a prompt or lyrics');
if (options.lyrics && options.lyrics.length > 3000) throw new Error('Lyrics too long for music_generation'); Try / catch
try {
const done = parseCompletedMusic(payload, region);
} catch (e) {
const m = /service (\d+)(.*)/.exec(e.message ?? '');
if (e instanceof CommandExecutionError && m) {
console.error(`MiniMax rejected generation (code ${m[1]}${m[2]}): check docs, adjust prompt/params, then retry.`);
} else throw e;
} Prevention
- Screen prompts/lyrics for content-policy risk before submission.
- Use documented model names and audio_setting values only.
- Record status_code/status_msg pairs you encounter to build an internal runbook.
- Retry only codes known to be transient; check account history first.
When it happens
Trigger: HTTP 200 with base_resp.status_code not in {0, 1004, 2049} — e.g. invalid prompt/lyrics parameters, content moderation refusal, model capacity errors, or any other service-side failure code returned in the envelope.
Common situations: Prompts or lyrics violating MiniMax content policy; unsupported model/output_format values for the account tier; transient capacity errors on the music model; malformed audio_setting (bad sample_rate/bitrate) rejected server-side.
Related errors
- Instagram private publish configure_sidecar failed
- CreateList failed: ${errors[0].message || JSON.stringify(err
- ${probe.detail}
- Cannot resolve aid for bvid: ${bvid}
- Bilibili user search returned malformed mid for @${name}
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/244dfaa921662415.
Report an issue: GitHub.