{"record":{"id":"1209604792ec8cf9","repo":"crewAIInc/crewAI","slug":"unable-to-find-the-dataset-for-dataset-type-ple","errorCode":null,"errorMessage":"Unable to find the dataset for {dataset_type}. Please make sure to pass a valid one","messagePattern":"Unable to find the dataset for (.+?)\\. Please make sure to pass a valid one","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_dataset.py","lineNumber":494,"sourceCode":"\n        # Set additional parameters dynamically depending upon the dataset that is being requested\n        if additional_params:\n            request_data.update(additional_params)\n\n        api_key = os.getenv(\"BRIGHT_DATA_API_KEY\")\n\n        headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application/json\",\n        }\n\n        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","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/crewai-tools/src/crewai_tools/tools/brightdata_tool/brightdata_dataset.py#L476-L512","documentation":"Raised by BrightDataDatasetTool when filter_dataset_by_id(dataset_type) does not return exactly one matching dataset entry. The tool keeps an internal registry of dataset types (e.g. 'amazon_product', 'maps'), and only the unambiguous single-match case proceeds; zero matches (or an ambiguous multi-match) raises this error.","triggerScenarios":"Calling the tool with dataset_type='unknown_api' or a typo like 'amazon_prod'; passing a dataset_type string that doesn't match any key in the tool's dataset registry before the Bright Data trigger POST.","commonSituations":"Guessing dataset type names instead of reading the tool's supported list, casing/underscore mismatches ('amazon-product' vs 'amazon_product'), version drift where a dataset id was renamed in the registry.","solutions":["Inspect the tool's dataset registry (the DATASET/filter mapping near filter_dataset_by_id) and use an exact supported dataset_type value.","Print the available types: most Bright Data tool builds expose the mapping as a module-level constant.","Pass dataset_type explicitly in the constructor or _run call instead of relying on defaults."],"exampleFix":"# before\ntool.run(url='https://www.amazon.com/dp/B0...', dataset_type='amazon_prod')\n\n# after\ntool.run(url='https://www.amazon.com/dp/B0...', dataset_type='amazon_product')","handlingStrategy":"validation","validationCode":"from crewai_tools.tools.brightdata_tool.brightdata_dataset import BrightDataDatasetTool\n\ntool = BrightDataDatasetTool()\nvalid = {d[\"dataset_id\"]: d for d in []}  # placeholder; enumerate registry:\n# derive the accepted set from the tool's own filter\naccepted = {t for t in tool._DATASET_REGISTRY} if hasattr(tool, \"_DATASET_REGISTRY\") else None\nassert dataset_type in accepted, f\"use one of {accepted}\"","typeGuard":null,"tryCatchPattern":"try:\n    result = tool.run(url=url, dataset_type=dataset_type)\nexcept ValueError as e:\n    if \"Unable to find the dataset\" in str(e):\n        dataset_type = prompt_user_or_default_dataset()\n        result = tool.run(url=url, dataset_type=dataset_type)\n    else:\n        raise","preventionTips":["Pin dataset_type to values copied from the tool's registry, not guessed names.","Wrap dataset_type in a config constant to avoid drift across call sites.","Add a unit test asserting your configured dataset_type resolves via filter_dataset_by_id."],"tags":["bright-data","dataset","validation","configuration"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}