{"record":{"id":"a91f5a1594c63f8a","repo":"clockworklabs/SpacetimeDB","slug":"invalid-entity-type-expected-one-of-reducer","errorCode":null,"errorMessage":"Invalid entity_type '{}'. Expected one of: reducer, table.","messagePattern":"Invalid entity_type '(.+?)'\\. Expected one of: reducer, table\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/describe.rs","lineNumber":74,"sourceCode":"    let no_config = args.get_flag(\"no_config\");\n    let raw_parts: Vec<String> = args\n        .get_many::<String>(\"describe_parts\")\n        .map(|vals| vals.cloned().collect())\n        .unwrap_or_default();\n    let config_targets = load_config_db_targets(no_config)?;\n    let resolved = resolve_database_with_optional_parts(\n        &raw_parts,\n        config_targets.as_deref(),\n        \"spacetime describe [database] [entity_type entity_name] --json [--no-config]\",\n    )?;\n    let entity = match resolved.remaining_args.as_slice() {\n        [] => None,\n        [entity_type, entity_name] => {\n            let entity_type = match entity_type.as_str() {\n                \"reducer\" => EntityType::Reducer,\n                \"table\" => EntityType::Table,\n                _ => {\n                    anyhow::bail!(\n                        \"Invalid entity_type '{}'. Expected one of: reducer, table.\",\n                        entity_type\n                    )\n                }\n            };\n            Some((entity_type, entity_name.as_str()))\n        }\n        _ => {\n            anyhow::bail!(\n                \"Invalid describe arguments.\\nUsage: spacetime describe [database] [entity_type entity_name] --json [--no-config]\"\n            );\n        }\n    };\n\n    let mut config = config;\n    let server_from_cli = args.get_one::<String>(\"server\").map(|s| s.as_ref());\n    let server = server_from_cli.or(resolved.server.as_deref());\n    let force = args.get_flag(\"force\");","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/describe.rs#L56-L92","documentation":"`spacetime describe` accepts an optional (entity_type, entity_name) pair after the database, and entity_type must be exactly 'reducer' or 'table' (lowercase). Any other word is rejected before the database schema is consulted. Note the argument grammar is strict: you must pass both entity_type and entity_name or neither.","triggerScenarios":"`spacetime describe <db> <type> <name>` where <type> is not the literal string 'reducer' or 'table' — e.g. 'view', 'entity', 'Table', or pluralized forms.","commonSituations":"Assuming newer schema entity kinds (views, types) are describable; capitalized or pluralized keywords; copy-pasting entity kinds from other tools' conventions.","solutions":["Use exactly `reducer` or `table` (lowercase, singular)","To inspect other entity kinds, run `spacetime describe <db>` for the full schema (add --json and filter with jq)"],"exampleFix":"# before\nspacetime describe mydb View user_view\n\n# after\nspacetime describe mydb   # full schema, then find the view in --json output","handlingStrategy":"type-guard","validationCode":"# Whitelist entity types before invoking the CLI\nETYPES='reducer table'\n[ $# -ge 2 ] && case \" $ETYPES \" in *\" $1 \"*) ;; *) echo \"entity_type must be: $ETYPES\" >&2; exit 2;; esac\nspacetime describe \"$DB\" \"$@\"","typeGuard":"fn entity_type(s: &str) -> Option<EntityType> {\n    match s {\n        \"reducer\" => Some(EntityType::Reducer),\n        \"table\" => Some(EntityType::Table),\n        _ => None,\n    }\n}","tryCatchPattern":"match entity_type(word) {\n    Some(t) => describe(db, t, name).await,\n    None => anyhow::bail!(\"entity_type must be 'reducer' or 'table', got '{word}'\"),\n}","preventionTips":["Remember only reducer and table are addressable; for views or types use full-schema output with --json and jq","Lowercase, singular keywords only — the match is case-sensitive"],"tags":["spacetimedb","cli","describe","enum","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}