{"record":{"id":"9ae980ecb8e82653","repo":"clockworklabs/SpacetimeDB","slug":"server-template-not-found","errorCode":null,"errorMessage":"Server template not found: {}","messagePattern":"Server template not found: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/init.rs","lineNumber":1423,"sourceCode":"                update_cargo_toml_name(project_path, &config.project_name)?;\n            }\n            Some(ClientLanguage::Csharp) => {\n                update_csproj_client_to_nuget(project_path)?;\n            }\n            None => {}\n        }\n    }\n\n    println!(\n        \"Setting up server ({})...\",\n        config.server_lang.map(|l| l.as_str()).unwrap_or(\"none\")\n    );\n    let server_dir = project_path.join(\"spacetimedb\");\n    let server_source = &template_def.server_source;\n    if let Some(files) = template_files.get(server_source.as_str()) {\n        copy_embedded_files(files, &server_dir)?;\n    } else {\n        anyhow::bail!(\"Server template not found: {}\", server_source);\n    }\n\n    // Update server name\n    match config.server_lang {\n        Some(ServerLanguage::TypeScript) => {\n            update_package_json(&server_dir, &config.project_name)?;\n        }\n        Some(ServerLanguage::Rust) => {\n            update_cargo_toml_name(&server_dir, &config.project_name)?;\n        }\n        Some(ServerLanguage::Csharp) => {\n            update_csproj_server_to_nuget(&server_dir)?;\n        }\n        Some(ServerLanguage::Cpp) => {\n            // No name update needed for C++ at the moment\n        }\n        None => {}\n    }","sourceCodeStart":1405,"sourceCodeEnd":1441,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/src/subcommands/init.rs#L1405-L1441","documentation":"The server half of a builtin template is copied from file sets embedded in the CLI binary, keyed by the catalog's `server_source` name. If the embedded assets contain no entry for that key — catalog and embedded files out of sync within the build — init aborts after the client half may already have been copied. Same failure family as the client variant, one phase later.","triggerScenarios":"A CLI build whose templates.json advertises a server_source with no matching embedded file set; server template directories renamed without updating the catalog.","commonSituations":"Pre-release or custom CLI builds; templates added to the catalog after the embedded assets were frozen; partial cleanup after this error leaves a copied client half behind.","solutions":["Update the SpacetimeDB CLI so the embedded catalog and assets match","Pick a different template or scaffold the server with `--lang`","If re-running after this error, clean the partially scaffolded project directory first","If it persists on the latest release, report it with the template id and CLI version"],"exampleFix":"# before — embedded server assets missing for this template\nspacetime init my-app --non-interactive --template fullstart-csharp\n\n# after — update CLI, clean partial output, fall back to --lang\nspacetime update\nrm -rf my-app\nspacetime init my-app --non-interactive --project-name my-app --lang csharp","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Update the CLI when template errors appear — embedded catalog/assets skew is fixed upstream","This error can fire after the client half is copied: clean the target directory before any retry","Pin a known-good CLI version in CI and keep a --lang fallback for server scaffolding"],"tags":["init","template","embedded-assets","version-skew"],"backgroundTag":"template-asset-missing","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}