{"record":{"id":"2b2db5d623acb59b","repo":"xtekky/gpt4free","slug":"failed-to-get-conversation-id-from-new-new-data","errorCode":null,"errorMessage":"Failed to get conversation ID from /new: {new_data}","messagePattern":"Failed to get conversation ID from /new: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"g4f/Provider/BraveSearch.py","lineNumber":311,"sourceCode":"                \"source\": \"newThread\" if is_deep else \"llmSuggest\",\n                \"enable_research\": \"true\" if is_deep else \"false\",\n                \"q\": prompt,\n                \"nonce\": nonce,\n                \"sig\": sig,\n            }\n\n            async with session.get(\n                NEW_ENDPOINT,\n                params=new_params,\n                headers={\n                    \"referer\": f\"{BRAVE_ASK_URL}?q={quote(prompt)}&source=newThread\"\n                },\n            ) as response:\n                await raise_for_status(response)\n                new_data = await response.json()\n                conversation.conversation_id = new_data.get(\"id\")\n                if not conversation.conversation_id:\n                    raise RuntimeError(\n                        f\"Failed to get conversation ID from /new: {new_data}\"\n                    )\n                debug.log(\n                    f\"BraveSearch: Conversation ID: {conversation.conversation_id}\"\n                )\n\n            yield conversation\n            yield ProviderInfo(**cls.get_dict(), model=model)\n\n            # ===== STEP 3: Stream the response =====\n            stream_params = {\n                \"language\": \"en\",\n                \"country\": \"us\",\n                \"ui_lang\": \"en-us\",\n                \"safesearch\": \"moderate\",\n                \"force_safesearch\": \"0\",\n                \"units_of_measurement\": \"metric\",\n                \"use_location\": \"1\",","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/xtekky/gpt4free/blob/973504e1770928ed5fb82f43da528f441ad9ddc3/g4f/Provider/BraveSearch.py#L293-L329","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"func canExtract(binDir string) error {\n    if err := os.MkdirAll(binDir, 0o755); err != nil {\n        return fmt.Errorf(\"binDir not writable: %w\", err)\n    }\n    probe := filepath.Join(binDir, \".write-probe\")\n    if err := os.WriteFile(probe, nil, 0o644); err != nil {\n        return fmt.Errorf(\"binDir not writable: %w\", err)\n    }\n    _ = os.Remove(probe)\n    return nil\n}","typeGuard":null,"tryCatchPattern":"if err := extractZip(...); err != nil {\n    // wipe partial state so the next attempt is clean, then surface\n    _ = os.RemoveAll(filepath.Join(binDir, \"python-home\"))\n    return fmt.Errorf(\"extract embedded runtime: %w\", err)\n}","preventionTips":["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"],"tags":["zip","extraction","filesystem","windows"],"backgroundTag":null,"analyzedSha":"973504e1770928ed5fb82f43da528f441ad9ddc3","analyzedAt":"2026-08-14T23:45:32.408Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}