{"record":{"id":"ae0310597a554c99","repo":"crewAIInc/crewAI","slug":"trigger-failed-await-trigger-response-text","errorCode":null,"errorMessage":"Trigger failed: {await trigger_response.text()}","messagePattern":"Trigger failed: (.+?)","errorType":"http","errorClass":"BrightDataDatasetToolException","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_dataset.py","lineNumber":506,"sourceCode":"        dataset_id = \"\"\n        dataset = self.filter_dataset_by_id(dataset_type)\n\n        if len(dataset) == 1:\n            dataset_id = dataset[0][\"dataset_id\"]\n        else:\n            raise ValueError(\n                f\"Unable to find the dataset for {dataset_type}. Please make sure to pass a valid one\"\n            )\n\n        async with aiohttp.ClientSession() as session:\n            async with session.post(\n                f\"{BRIGHTDATA_API_URL}/datasets/v3/trigger\",\n                params={\"dataset_id\": dataset_id, \"include_errors\": \"true\"},\n                json=[request_data],\n                headers=headers,\n            ) as trigger_response:\n                if trigger_response.status != 200:\n                    raise BrightDataDatasetToolException(\n                        f\"Trigger failed: {await trigger_response.text()}\",\n                        trigger_response.status,\n                    )\n                trigger_data = await trigger_response.json()\n                snapshot_id = trigger_data.get(\"snapshot_id\")\n\n            elapsed = 0\n            while elapsed < timeout:\n                await asyncio.sleep(polling_interval)\n                elapsed += polling_interval\n\n                async with session.get(\n                    f\"{BRIGHTDATA_API_URL}/datasets/v3/progress/{snapshot_id}\",\n                    headers=headers,\n                ) as status_response:\n                    if status_response.status != 200:\n                        raise BrightDataDatasetToolException(\n                            f\"Status check failed: {await status_response.text()}\",","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_dataset.py#L488-L524","documentation":"A BrightDataDatasetToolException raised when the POST to {BRIGHTDATA_API_URL}/datasets/v3/trigger returns a non-200 status. This is the first HTTP step of the trigger-then-poll workflow; failure means Bright Data rejected the job submission itself (auth, bad dataset payload, quota), and the response body text plus status code are attached.","triggerScenarios":"Expired or wrong BRIGHT_DATA_API_KEY (401/403), malformed request_data for the dataset type (400), unactivated dataset/zone in the Bright Data account (422), or insufficient quota — any non-200 from the trigger endpoint.","commonSituations":"Free-trial accounts without the dataset unlocked, API key rotated but env var stale, request_data schema drift after Bright Data API updates.","solutions":["Read the response text embedded in the exception — it states the exact Bright Data rejection reason.","Verify BRIGHT_DATA_API_KEY is current and the target dataset is activated in your Bright Data account.","Validate request_data against the dataset type's expected input schema before calling.","If 429/5xx, retry with backoff (wrap the call and catch BrightDataDatasetToolException, inspecting .status_code)."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import os\n\nassert os.getenv(\"BRIGHT_DATA_API_KEY\"), \"BRIGHT_DATA_API_KEY required before triggering datasets\"\nassert isinstance(request_data, dict) and request_data, \"request_data must be a non-empty dict\"","typeGuard":null,"tryCatchPattern":"from crewai_tools.tools.brightdata_tool import BrightDataDatasetToolException\n\nfor attempt in range(3):\n    try:\n        result = tool.run(url=url, dataset_type=dataset_type)\n        break\n    except BrightDataDatasetToolException as e:\n        if e.status_code in (429, 500, 502, 503) and attempt < 2:\n            time.sleep(2 ** attempt)\n            continue\n        raise  # 4xx (auth/bad request) — do not retry","preventionTips":["Verify the Bright Data account has the target dataset activated before automating calls.","Treat status_code on BrightDataDatasetToolException as the retry decision point.","Log the response body embedded in the exception — it carries Bright Data's reason code."],"tags":["bright-data","http","api-error","dataset"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}