{"record":{"id":"98e3c04c4e78b215","repo":"crewAIInc/crewAI","slug":"folder-name-is-a-reserved-python-keyword","errorCode":null,"errorMessage":"'{folder_name}' is a reserved Python keyword","messagePattern":"'(.+?)' is a reserved Python keyword","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/create_json_crew.py","lineNumber":891,"sourceCode":"\n    dmn_mode = is_dmn_mode_enabled()\n    if not dmn_mode:\n        enable_prompt_line_editing()\n\n    name = name.rstrip(\"/\")\n    if not name.strip():\n        raise ValueError(\"Project name cannot be empty\")\n\n    folder_name = name.replace(\" \", \"_\").replace(\"-\", \"_\").lower()\n    folder_name = re.sub(r\"[^a-zA-Z0-9_]\", \"\", folder_name)\n\n    if not folder_name or folder_name[0].isdigit():\n        raise ValueError(\n            f\"Project name '{name}' produces invalid folder name '{folder_name}'\"\n        )\n\n    if keyword.iskeyword(folder_name):\n        raise ValueError(f\"'{folder_name}' is a reserved Python keyword\")\n\n    folder_path = Path(folder_name)\n    if folder_path.exists():\n        if dmn_mode:\n            raise click.ClickException(f\"Folder {folder_name} already exists.\")\n        if not click.confirm(f\"Folder {folder_name} already exists. Override?\"):\n            click.secho(\"Cancelled.\", fg=\"yellow\")\n            sys.exit(0)\n        shutil.rmtree(folder_path)\n\n    click.echo()\n    click.secho(f\"  Creating crew: {name}\", fg=\"green\", bold=True)\n\n    default_llm = _default_model_for_provider(provider)\n    if dmn_mode:\n        agents, tasks, crew_settings = _default_agents_and_tasks(default_llm)\n    else:\n        agents, tasks, crew_settings = _wizard_agents_and_tasks(","sourceCodeStart":873,"sourceCodeEnd":909,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/create_json_crew.py#L873-L909","documentation":"Raised by _check_index_exists when scoped_index is true and index_name is not among the Search indexes returned by scope.search_indexes().get_all_indexes(). Scoped Search indexes live inside a specific bucket.scope, so the tool checks the scope's index list first (the cluster-level branch raises the same message at line 128).","triggerScenarios":"Initializing the tool with scoped_index=True and an index_name that was never created at that scope, or an index created at cluster level while the tool looks in the scope.","commonSituations":"Index created in the Couchbase UI under a different bucket/scope, index name typo, index creation not yet propagated, or scoped_index mismatch with where the index actually lives.","solutions":["Create the Search index in the right bucket/scope (Couchbase UI -> Search -> Add index, or the index REST API) with exactly index_name.","If the index exists at cluster level, pass scoped_index=False (and a cluster connection) instead.","List indexes to confirm: [i.name for i in scope.search_indexes().get_all_indexes()]."],"exampleFix":"# before\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='hotel_idx', scoped_index=True)  # ValueError\n# after\n# create scoped index 'hotel_idx' on travel.inventory.hotel first, then:\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='hotel_idx', scoped_index=True)","handlingStrategy":"validation","validationCode":"if scoped_index:\n    names = {i.name for i in cluster.bucket(bucket_name).scope(scope_name).search_indexes().get_all_indexes()}\n    if index_name not in names:\n        raise ValueError(f\"index '{index_name}' not found in scope '{scope_name}'; available: {sorted(names)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision the Search index (via UI, REST, or index manager API) before tool init.","Know whether your Couchbase version/cluster uses scoped vs cluster-level Search indexes and set scoped_index accordingly.","Index creation is asynchronous — allow time for it to build before checking."],"tags":["couchbase","search","validation","index"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}