crewAIInc/crewAI · error · ValueError

Project name cannot be empty

Error message

Project name cannot be empty

What it means

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.

Source

Thrown at lib/cli/src/crewai_cli/create_json_crew.py:880

# ── Main ────────────────────────────────────────────────────────


def create_json_crew(
    name: str,
    provider: str | None = None,
    skip_provider: bool = False,
) -> None:
    """Scaffold a new JSON-first crew project."""
    import keyword
    import shutil

    dmn_mode = is_dmn_mode_enabled()
    if not dmn_mode:
        enable_prompt_line_editing()

    name = name.rstrip("/")
    if not name.strip():
        raise ValueError("Project name cannot be empty")

    folder_name = name.replace(" ", "_").replace("-", "_").lower()
    folder_name = re.sub(r"[^a-zA-Z0-9_]", "", folder_name)

    if not folder_name or folder_name[0].isdigit():
        raise ValueError(
            f"Project name '{name}' produces invalid folder name '{folder_name}'"
        )

    if keyword.iskeyword(folder_name):
        raise ValueError(f"'{folder_name}' is a reserved Python keyword")

    folder_path = Path(folder_name)
    if folder_path.exists():
        if dmn_mode:
            raise click.ClickException(f"Folder {folder_name} already exists.")
        if not click.confirm(f"Folder {folder_name} already exists. Override?"):
            click.secho("Cancelled.", fg="yellow")

View on GitHub (pinned to 754d7323be)

Solutions

  1. Create the scope first: cbt scope create <bucket>.<scope> ... or the Couchbase UI / SDK collection_manager.create_scope.
  2. Or point scope_name at an existing scope (use '_default' if you never created one).
  3. List available scopes to confirm the exact name: bucket.collections().get_all_scopes().

Example fix

# before
tool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='inventory', collection_name='hotel', index_name='idx')  # ValueError
# after
tool = CouchbaseFTSVectorSearchTool(bucket_name='travel', scope_name='_default', collection_name='hotel', index_name='idx')
Defensive patterns

Strategy: validation

Validate before calling

scopes = {s.name for s in cluster.bucket(bucket_name).collections().get_all_scopes()}
if scope_name not in scopes:
    raise ValueError(f"scope '{scope_name}' not in {bucket_name}; available: {sorted(scopes)}")

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of crewAIInc/crewAI@754d7323be (2026-08-15). Data as JSON: /api/errors/c1c5261150230690. Report an issue: GitHub.