{"record":{"id":"ca84bc80efe05b69","repo":"SillyTavern/SillyTavern","slug":"tts-generation-failed-response-statustext","errorCode":null,"errorMessage":"TTS Generation Failed: ${response.statusText}","messagePattern":"TTS Generation Failed: (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"src/endpoints/volcengine.js","lineNumber":68,"sourceCode":"                    'additions': JSON.stringify({\n                        'mute_cut_threshold': '400',\n                        'mute_cut_remain_ms': '1',\n                        'explicit_language': 'crosslingual',\n                        'enable_language_detector': true,\n                        'disable_markdown_filter': true,\n                        'cache_config': {\n                            'use_cache': true,\n                            'text_type': 1,\n                        },\n                    }),\n                },\n            }),\n        });\n\n        if (!response.ok) {\n            const logid = response.headers.get('X-Tt-Logid') || '';\n            console.warn('Volcengine Request failed', response.status, response.statusText, logid);\n            return res.header('X-Tt-Logid', logid).status(500).send(`TTS Generation Failed: ${response.statusText}`);\n        }\n        const decoder = new TextDecoder();\n\n        const result = await new Promise((resolve, reject) => {\n            let audioChunks_ = [];\n            let buffer = '';\n            if (!response.body) {\n                reject(new Error('Response body is null'));\n                return;\n            }\n            response.body.on('data', (chunk) => {\n                buffer += decoder.decode(chunk, { stream: true });\n\n                const lines = buffer.split('\\n');\n                buffer = lines.pop() || '';\n\n                for (const line of lines) {\n                    if (!line.trim()) continue;","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/SillyTavern/SillyTavern/blob/8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8/src/endpoints/volcengine.js#L50-L86","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the statusText and the returned X-Tt-Logid — Volcengine support needs the Logid to trace the call.","Verify appId/accessKey are current and the account has active quota/balance.","Confirm resource_id and voice_speaker are valid and enabled for the account.","If provider_endpoint was customized, reset it to the default or correct regional URL.","Retry after a brief backoff if the failure looks transient (5xx from upstream)."],"exampleFix":"// before\nif (!response.ok) { return res.status(500).send(`TTS Generation Failed: ${response.statusText}`); }\n// after - surface status code + logid for diagnosis\nif (!response.ok) {\n  const body = await response.text().catch(() => '');\n  return res.status(502).header('X-Tt-Logid', logid).send(`Volcengine ${response.status} ${response.statusText}: ${body}`);\n}","handlingStrategy":"try-catch","validationCode":"// pre-flight: verify creds + resource_id are valid via a cheap call, or surface upstream status to the user\nif (!hasVolcengineCreds(dir)) throw new Error('credentials missing');","typeGuard":null,"tryCatchPattern":"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 */ }","preventionTips":["Keep the X-Tt-Logid for Volcengine support traces.","Monitor quota/balance on the Volcengine console.","Treat upstream 5xx as transient with backoff."],"tags":["volcengine","tts","upstream","http-500","network"],"backgroundTag":null,"analyzedSha":"8172dcd0ee672d3cd9a5e5f7af134f91a45cd2b8","analyzedAt":"2026-08-13T07:48:40.832Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}