xtekky/gpt4free · error · RuntimeError
Failed to get conversation ID from /new: {new_data}
Error message
Failed to get conversation ID from /new: {new_data} What it means
The stdlib archive/zip extraction of the embedded pbs runtime into binDir failed; the wrapped error carries the real cause (unsupported compression, checksum mismatch, or a filesystem error while writing entries like ENOSPC or EACCES).
Source
Thrown at g4f/Provider/BraveSearch.py:311
"source": "newThread" if is_deep else "llmSuggest",
"enable_research": "true" if is_deep else "false",
"q": prompt,
"nonce": nonce,
"sig": sig,
}
async with session.get(
NEW_ENDPOINT,
params=new_params,
headers={
"referer": f"{BRAVE_ASK_URL}?q={quote(prompt)}&source=newThread"
},
) as response:
await raise_for_status(response)
new_data = await response.json()
conversation.conversation_id = new_data.get("id")
if not conversation.conversation_id:
raise RuntimeError(
f"Failed to get conversation ID from /new: {new_data}"
)
debug.log(
f"BraveSearch: Conversation ID: {conversation.conversation_id}"
)
yield conversation
yield ProviderInfo(**cls.get_dict(), model=model)
# ===== STEP 3: Stream the response =====
stream_params = {
"language": "en",
"country": "us",
"ui_lang": "en-us",
"safesearch": "moderate",
"force_safesearch": "0",
"units_of_measurement": "metric",
"use_location": "1",View on GitHub (pinned to 973504e177)
Solutions
- Read the wrapped error: a zip.ErrChecksum/ErrFormat means a corrupt archive → re-fetch and rebuild; an os error like ENOSPC/EACCES means an environment problem
- Remove the partial install dir (rm -rf <binDir>/python-home) and retry so extraction starts clean
- Free disk space or fix permissions on binDir (chown/chmod) so the process can write the full runtime layout
- On Windows, close any process holding files inside python-home (previous python run, antivirus scan) before retrying
- If the archive is genuinely truncated, rerun fetch-python.sh and verify the zip opens with unzip -t before rebuilding
Defensive patterns
Strategy: validation
Validate before calling
func canExtract(binDir string) error {
if err := os.MkdirAll(binDir, 0o755); err != nil {
return fmt.Errorf("binDir not writable: %w", err)
}
probe := filepath.Join(binDir, ".write-probe")
if err := os.WriteFile(probe, nil, 0o644); err != nil {
return fmt.Errorf("binDir not writable: %w", err)
}
_ = os.Remove(probe)
return nil
} Try / catch
if err := extractZip(...); err != nil {
// wipe partial state so the next attempt is clean, then surface
_ = os.RemoveAll(filepath.Join(binDir, "python-home"))
return fmt.Errorf("extract embedded runtime: %w", err)
} Prevention
- Pre-check free disk space (runtime is hundreds of MB) before extraction
- Extract to a temp dir and atomically rename into python-home so partial trees never linger
- Clean python-home before re-extracting to avoid read-only file collisions, especially on Windows
When it happens
Trigger: Embedded zip is corrupt (bad CRC, unsupported method); binDir or python-home is not writable; disk full during extraction; extraction hits an existing read-only file from a previous partial install; symlink/permission entries in the archive that os-level writes reject.
Common situations: Leftover partial extraction from a previous crashed run making files read-only or locked (Windows file locks especially); installing into a directory owned by another user; container image with a read-only layer; truncated archive from a flaky fetch step.
Related errors
- archive has no top-level directory
- unsafe path in archive: %s
- {r.status} {response body text}
- Failed to extract nonce/sig from __data.json. Got: {tap_data
- Missing cookie: {cls.anon_cookie_name}
AI-assisted analysis of xtekky/gpt4free@973504e177 (2026-08-14).
Data as JSON: /api/errors/2b2db5d623acb59b.
Report an issue: GitHub.