{"record":{"id":"9be868fa68e6051d","repo":"BerriAI/litellm","slug":"no-polling-url-in-bfl-response","errorCode":null,"errorMessage":"No polling_url in BFL response","messagePattern":"No polling_url in BFL response","errorType":"exception","errorClass":"BlackForestLabsError","httpStatus":500,"severity":"error","filePath":"litellm/llms/black_forest_labs/image_edit/handler.py","lineNumber":330,"sourceCode":"        # Parse initial response to get polling URL\n        try:\n            response_data: Final = initial_response.json()\n        except Exception as e:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"Error parsing initial response: {e}\",\n            )\n\n        # Check for immediate errors\n        if \"errors\" in response_data:\n            raise BlackForestLabsError(\n                status_code=initial_response.status_code,\n                message=f\"BFL error: {response_data['errors']}\",\n            )\n\n        polling_url: Final = response_data.get(\"polling_url\")\n        if not polling_url:\n            raise BlackForestLabsError(\n                status_code=500,\n                message=\"No polling_url in BFL response\",\n            )\n\n        # Reject polling URLs that don't belong to BFL-controlled infrastructure.\n        # 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(","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/litellm/llms/black_forest_labs/image_edit/handler.py#L312-L348","documentation":"Error \"No polling_url in BFL response\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/black_forest_labs/image_edit/handler.py:330 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The BFL response lacked a polling_url; check the request parameters and API status."],"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-15T17:31:12.345Z"}