{"record":{"id":"639f69986b12564a","repo":"BerriAI/litellm","slug":"polling-failed-response-text","errorCode":null,"errorMessage":"Polling failed: {response.text}","messagePattern":"Polling failed: (.+?)","errorType":"exception","errorClass":"BlackForestLabsError","httpStatus":null,"severity":"error","filePath":"litellm/llms/black_forest_labs/image_edit/handler.py","lineNumber":354,"sourceCode":"        # BFL uses regional subdomains (e.g. gateway.bfl.ai) that differ from the\n        # submission host (api.bfl.ai), so we validate against the registered\n        # domain rather than doing a strict same-origin check. VERIA-51.\n        assert_bfl_polling_url(polling_url)\n\n        # Get just the auth header for polling\n        polling_headers: Final = {\"x-key\": headers.get(\"x-key\", \"\")}\n\n        start_time: Final = time.time()\n        verbose_logger.debug(\"BFL starting sync polling at %s\", polling_url)\n\n        while time.time() - start_time < max_wait:\n            response = sync_client.get(\n                url=polling_url,\n                headers=polling_headers,\n            )\n\n            if response.status_code != 200:\n                raise BlackForestLabsError(\n                    status_code=response.status_code,\n                    message=f\"Polling failed: {response.text}\",\n                )\n\n            data = response.json()\n            status = data.get(\"status\")\n\n            verbose_logger.debug(\"BFL poll status: %s\", status)\n\n            if status == \"Ready\":\n                return response\n            elif status in [\n                \"Error\",\n                \"Failed\",\n                \"Content Moderated\",\n                \"Request Moderated\",\n            ]:\n                raise BlackForestLabsError(","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/black_forest_labs/image_edit/handler.py#L336-L372","documentation":"Error \"Polling failed: {response.text}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the BFL polling response text; the job may have failed."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}