{"record":{"id":"e2753e0d1038a717","repo":"crewAIInc/crewAI","slug":"project-name-name-produces-invalid-folder-name","errorCode":null,"errorMessage":"Project name '{name}' produces invalid folder name '{folder_name}'","messagePattern":"Project name '(.+?)' produces invalid folder name '(.+?)'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/create_json_crew.py","lineNumber":886,"sourceCode":"    skip_provider: bool = False,\n) -> None:\n    \"\"\"Scaffold a new JSON-first crew project.\"\"\"\n    import keyword\n    import shutil\n\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","sourceCodeStart":868,"sourceCodeEnd":904,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/create_json_crew.py#L868-L904","documentation":"Raised by _check_scope_and_collection_exists when the scope exists but collection_name is not among its collections. It fires only after the scope check passed, so the scope is correct and only the collection name is wrong.","triggerScenarios":"Initializing the tool with a collection that has not been created in the (existing) scope — e.g. collection_name='hotels' when only '_default' exists in that scope.","commonSituations":"Migration scripts that create the scope but not the collection, plural/singular naming mismatches ('hotel' vs 'hotels'), or environment-specific collection names.","solutions":["Create the collection: cbt collection create <bucket>.<scope>.<collection> or scope.collection_manager.create_collection(...).","Or set collection_name to an existing collection ('_default' works in the default scope).","Enumerate collections to verify: [c.name for s in bucket.collections().get_all_scopes() if s.name == scope for c in s.collections]."],"exampleFix":"# before\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='_default', collection_name='hotels', index_name='idx')  # ValueError\n# after\nfrom couchbase.cluster import Cluster\n# create collection once: cluster.bucket('travel').collections().create_collection('_default', 'hotels')\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='_default', collection_name='hotels', index_name='idx')","handlingStrategy":"validation","validationCode":"cols = {\n    c.name\n    for s in cluster.bucket(bucket_name).collections().get_all_scopes()\n    if s.name == scope_name\n    for c in s.collections\n}\nif collection_name not in cols:\n    raise ValueError(f\"collection '{collection_name}' not in scope '{scope_name}'; available: {sorted(cols)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create collections in the same provisioning script that creates scopes.","Verify collection names against the cluster listing instead of docs/memory.","Use the same names in provisioning and tool config from a single source of truth."],"tags":["couchbase","database","validation","configuration"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}