SillyTavern/SillyTavern · error

TTS Generation Failed: ${response.statusText}

Error message

TTS Generation Failed: ${response.statusText}

What it means

HTTP 500 with body `TTS Generation Failed: <statusText>` returned when the upstream Volcengine endpoint responds with a non-2xx status. The handler checks `response.ok` and forwards the upstream statusText (plus the X-Tt-Logid header) so the client sees why synthesis failed.

Source

Thrown at src/endpoints/volcengine.js:68

                    'additions': JSON.stringify({
                        'mute_cut_threshold': '400',
                        'mute_cut_remain_ms': '1',
                        'explicit_language': 'crosslingual',
                        'enable_language_detector': true,
                        'disable_markdown_filter': true,
                        'cache_config': {
                            'use_cache': true,
                            'text_type': 1,
                        },
                    }),
                },
            }),
        });

        if (!response.ok) {
            const logid = response.headers.get('X-Tt-Logid') || '';
            console.warn('Volcengine Request failed', response.status, response.statusText, logid);
            return res.header('X-Tt-Logid', logid).status(500).send(`TTS Generation Failed: ${response.statusText}`);
        }
        const decoder = new TextDecoder();

        const result = await new Promise((resolve, reject) => {
            let audioChunks_ = [];
            let buffer = '';
            if (!response.body) {
                reject(new Error('Response body is null'));
                return;
            }
            response.body.on('data', (chunk) => {
                buffer += decoder.decode(chunk, { stream: true });

                const lines = buffer.split('\n');
                buffer = lines.pop() || '';

                for (const line of lines) {
                    if (!line.trim()) continue;

View on GitHub (pinned to 8172dcd0ee)

Solutions

  1. Read the statusText and the returned X-Tt-Logid — Volcengine support needs the Logid to trace the call.
  2. Verify appId/accessKey are current and the account has active quota/balance.
  3. Confirm resource_id and voice_speaker are valid and enabled for the account.
  4. If provider_endpoint was customized, reset it to the default or correct regional URL.
  5. Retry after a brief backoff if the failure looks transient (5xx from upstream).

Example fix

// before
if (!response.ok) { return res.status(500).send(`TTS Generation Failed: ${response.statusText}`); }
// after - surface status code + logid for diagnosis
if (!response.ok) {
  const body = await response.text().catch(() => '');
  return res.status(502).header('X-Tt-Logid', logid).send(`Volcengine ${response.status} ${response.statusText}: ${body}`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-flight: verify creds + resource_id are valid via a cheap call, or surface upstream status to the user
if (!hasVolcengineCreds(dir)) throw new Error('credentials missing');

Try / catch

try { const r = await fetch(endpoint, {...}); if (!r.ok) { const logid = r.headers.get('X-Tt-Logid'); throw new Error(`${r.status} ${r.statusText} logid=${logid}`); } } catch (e) { /* show message, retry on 5xx */ }

Prevention

When it happens

Trigger: Volcengine returns 4xx/5xx: invalid credentials/signature, unknown voice/resource_id, quota exhausted, account in arrears, malformed req_params, or upstream outage. response.ok is false.

Common situations: Access key revoked or rotated; resource_id not authorized for the account; text exceeds length limits; rate limit/quota hit; Volcengine regional endpoint changed; provider_endpoint overridden to a wrong URL.

Related errors


AI-assisted analysis of SillyTavern/SillyTavern@8172dcd0ee (2026-08-13). Data as JSON: /api/errors/ca84bc80efe05b69. Report an issue: GitHub.