SillyTavern/SillyTavern · error

TTS Generation Failed: ${error}

Error message

TTS Generation Failed: ${error}

What it means

HTTP 500 with body `TTS Generation Failed: <error>` from the route's outer catch. Any thrown exception during the fetch — network failure, DNS, TLS, or a rejected stream read promise (`Error reading Volcengine TTS stream`) — is caught here and stringified into the response.

Source

Thrown at src/endpoints/volcengine.js:134

                    } catch (e) {
                        reject(`Error parsing final Volcengine TTS stream line: ${e}`);
                    }
                }
                resolve(audioChunks_);
            });

            response.body.on('error', (error) => {
                reject(`Error reading Volcengine TTS stream: ${error}`);
            });
        });

        const finalAudioData = Buffer.concat(result);

        res.set('Content-Type', 'audio/mpeg');
        res.status(200).send(finalAudioData);
    } catch (error) {
        console.error('Volcengine generate-voice fetch failed', error);
        res.status(500).send(`TTS Generation Failed: ${error}`);
    }
});

View on GitHub (pinned to 8172dcd0ee)

Solutions

  1. Check outbound connectivity from the server to openspeech.bytedance.com (or the custom endpoint) — curl the endpoint.
  2. If behind a proxy, configure HTTP_PROXY/HTTPS_PROXY or the app's proxy settings.
  3. Inspect the server log: `console.error('Volcengine generate-voice fetch failed', error)` shows the real cause (ENOTFOUND, ECONNRESET, certificate error).
  4. Handle null response.body by validating response.ok and presence of body before streaming.
  5. Retry with backoff for transient network errors.

Example fix

// before
response.body.on('error', (error) => { reject(`Error reading Volcengine TTS stream: ${error}`); });
// after - typed rejection + null-body guard
if (!response.ok || !response.body) { reject(new Error(`No TTS stream (status ${response.status})`)); return; }
response.body.on('error', (err) => { reject(new Error(`TTS stream read failed: ${err.message}`)); });
Defensive patterns

Strategy: retry

Validate before calling

// confirm reachability before streaming
const probe = await fetch(endpoint, { method:'HEAD' }).catch(() => null);
if (!probe) throw new Error('Volcengine endpoint unreachable');

Try / catch

try { /* fetch + stream */ } catch (e) { if (isTransientNetError(e)) { await backoff(); retry(); } else { console.error(e); res.status(500).send(`TTS Generation Failed: ${e.message}`); } }

Prevention

When it happens

Trigger: fetch() rejects (no network, DNS failure, TLS error, provider_endpoint unreachable), response.body is null (reject 'Response body is null'), or response.body emits 'error' mid-stream causing the promise to reject with the stream error string.

Common situations: Server has no outbound internet or is behind a proxy that blocks the Volcengine host; custom provider_endpoint is wrong/unreachable; TLS cert chain issue; connection dropped mid-stream; response had no body (e.g. 204 or HEAD-like).

Related errors


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