{"record":{"id":"c1c5261150230690","repo":"crewAIInc/crewAI","slug":"project-name-cannot-be-empty","errorCode":null,"errorMessage":"Project name cannot be empty","messagePattern":"Project name cannot be empty","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"lib/cli/src/crewai_cli/create_json_crew.py","lineNumber":880,"sourceCode":"# ── Main ────────────────────────────────────────────────────────\n\n\ndef create_json_crew(\n    name: str,\n    provider: str | None = None,\n    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\")","sourceCodeStart":862,"sourceCodeEnd":898,"githubUrl":"https://github.com/crewAIInc/crewAI/blob/754d7323beb2fd042e33444a115ea2d5a47193f0/lib/cli/src/crewai_cli/create_json_crew.py#L862-L898","documentation":"Raised by CouchbaseFTSVectorSearchTool._check_scope_and_collection_exists when the configured scope_name is absent from the bucket. The method enumerates every scope (and its collections) via bucket.collections().get_all_scopes() into a name map, then verifies scope_name before verifying collection_name inside it.","triggerScenarios":"Initializing the tool with scope_name='my_scope' when the bucket only contains the default '_default' scope (or a differently named one); also raised for typos or when pointed at the wrong bucket.","commonSituations":"Fresh Couchbase bucket where only _default exists, dev-vs-prod naming drift, scope created in a different bucket, or copied config with a stale scope name.","solutions":["Create the scope first: cbt scope create <bucket>.<scope> ... or the Couchbase UI / SDK collection_manager.create_scope.","Or point scope_name at an existing scope (use '_default' if you never created one).","List available scopes to confirm the exact name: bucket.collections().get_all_scopes()."],"exampleFix":"# before\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='idx')  # ValueError\n# after\ntool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='_default', collection_name='hotel', index_name='idx')","handlingStrategy":"validation","validationCode":"scopes = {s.name for s in cluster.bucket(bucket_name).collections().get_all_scopes()}\nif scope_name not in scopes:\n    raise ValueError(f\"scope '{scope_name}' not in {bucket_name}; available: {sorted(scopes)}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision scopes/collections (idempotent create-if-missing) before constructing the tool.","Centralize bucket/scope/collection names in one config validated at startup.","In tests, spin up a real Couchbase container and run the same provisioning script."],"tags":["couchbase","database","validation","configuration"],"backgroundTag":null,"analyzedSha":"754d7323beb2fd042e33444a115ea2d5a47193f0","analyzedAt":"2026-08-15T04:06:56.746Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}