xtekky/gpt4free · critical · Error

{r.status} {response body text}

Error message

{r.status} {response body text}

What it means

Thrown by the Go wrapper when it cannot stat a python interpreter inside the downloaded runtime directory (binDir/python-home). The code probes platform-specific candidate paths (python-home/python.exe on Windows, python-home/bin/python on unix) and errors when none exists as a regular file. It almost always means the embedded pbs (python-build-standalone) runtime was never extracted or the extraction produced an unexpected layout.

Source

Thrown at g4f/Provider/audio/ElevenLabs.py:171

            'error-callback': (e) => rej(new Error('hcaptcha: ' + e))
        }});
        hcaptcha.execute(w);
    }});
    const r = await fetch(
        'https://api.elevenlabs.io/v1/text-to-speech/' + {_voice} + '/stream/with-timestamps/anonymous?output_format=' + {_format},
        {{
            method: 'POST',
            headers: {{'Content-Type': 'application/json'}},
            body: JSON.stringify({{
                text: {_text},
                model_id: {_model},
                voice_settings: {{speed: 1}},
                hcaptcha_token: token,
                language_code: {_lang}
            }})
        }}
    );
    if (!r.ok) throw new Error(r.status + ' ' + await r.text());
    const reader = r.body.getReader(), dec = new TextDecoder();
    let buf = '', chunks = [];
    while (true) {{
        const {{done, value}} = await reader.read();
        if (done) break;
        buf += dec.decode(value, {{stream: true}});
        const lines = buf.split('\\n');
        buf = lines.pop() || '';
        for (const ln of lines) {{
            const t = ln.trim();
            if (!t) continue;
            // Accept both plain NDJSON and SSE "data:" prefixed lines
            const d = t.startsWith('data:') ? t.slice(5).trim() : t;
            try {{
                const p = JSON.parse(d);
                if (p.audio_base64) chunks.push(p.audio_base64);
            }} catch (e) {{}}
        }}

View on GitHub (pinned to 973504e177)

Solutions

  1. Re-run the runtime bootstrap (the command that triggers runtime download/extraction, e.g. re-run g4f-go so extractEmbedded reinstalls) so python-home is populated
  2. Verify the expected path exists: ls <binDir>/python-home/bin/python (unix) or <binDir>/python-home/python.exe (windows); if python-home is missing or empty, delete binDir and retry for a clean extraction
  3. Check the extraction step's logs for a prior 'extract embedded runtime' or 'no embedded runtime archive' failure and fix that first
  4. If binDir is configurable, confirm it points to the directory the runtime was actually installed into, not a fresh/incorrect path
  5. On unix, confirm the interpreter file is a regular file with execute permission and not renamed by the archive layout (update candidates list if the pbs layout version changed)
Defensive patterns

Strategy: validation

Validate before calling

func runtimeReady(binDir string) bool {
    home := filepath.Join(binDir, "python-home")
    exe := filepath.Join(home, "python.exe")
    if runtime.GOOS != "windows" {
        exe = filepath.Join(home, "bin", "python")
    }
    fi, err := os.Stat(exe)
    return err == nil && !fi.IsDir()
}

// call before any API that spawns the interpreter:
if !runtimeReady(binDir) {
    // run the runtime install/bootstrap flow first
}

Prevention

When it happens

Trigger: Calling any g4f-go entrypoint that resolves the interpreter (pythonExecutable) before EnsureRuntime/extractEmbedded has run, or after extraction failed silently; also when binDir points at a stale or manually pruned directory where python-home exists but the interpreter file is missing or is a directory.

Common situations: First run on a fresh machine without running the runtime bootstrap; a partial download/extraction interrupted midway; an antivirus or sync tool quarantining the python binary; binDir overridden via config to a path that was never populated; non-standard pbs archive layout with the interpreter at a different relative path.

Related errors


AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14). Data as JSON: /api/errors/68aab8e1211342e1. Report an issue: GitHub.