{"record":{"id":"1da7ada6db5a2b6a","repo":"clockworklabs/SpacetimeDB","slug":"invaliddata","errorCode":"InvalidData","errorMessage":"workspace manifest is not a table","messagePattern":"workspace manifest is not a table","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/build.rs","lineNumber":449,"sourceCode":"    // We happen to know our own directory structure, so we can just walk the tree to get to the root.\n    let repo_root = manifest_dir.join(\"..\").join(\"..\");\n    repo_root.canonicalize().unwrap_or_else(|err| {\n        panic!(\n            \"Failed to canonicalize repo_root path {}: {err:#?}\",\n            repo_root.display()\n        )\n    })\n}\n\nfn extract_workspace_metadata(path: &Path) -> io::Result<(String, BTreeMap<String, String>)> {\n    let content = fs::read_to_string(path)?;\n    let parsed: Value = content\n        .parse()\n        .map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;\n\n    let table = parsed\n        .as_table()\n        .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, \"workspace manifest is not a table\"))?;\n\n    let workspace = table\n        .get(\"workspace\")\n        .and_then(Value::as_table)\n        .ok_or_else(|| io::Error::new(io::ErrorKind::InvalidData, \"workspace section missing\"))?;\n\n    let edition = workspace\n        .get(\"package\")\n        .and_then(Value::as_table)\n        .and_then(|pkg| pkg.get(\"edition\"))\n        .and_then(Value::as_str)\n        .unwrap_or(\"2021\")\n        .to_string();\n\n    let mut versions = BTreeMap::new();\n    if let Some(deps) = workspace.get(\"dependencies\").and_then(Value::as_table) {\n        for (name, value) in deps {\n            let version_opt = match value {","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/cli/build.rs#L431-L467","documentation":"When preparing a build, the spacetime CLI parses the module workspace's Cargo.toml and requires the TOML document's root to be a table (mapping). Valid TOML documents are virtually always root tables, so this InvalidData error is a defensive check that mainly fires on malformed or exotic files. If you see it, the manifest is not a normal Cargo mapping.","triggerScenarios":"`spacetime build` or publish resolving a Cargo.toml whose parsed TOML root is not a table — a malformed or non-Cargo file rather than a valid manifest.","commonSituations":"Corrupted or hand-constructed Cargo.toml; in practice almost all real manifest problems surface as 'workspace section missing' instead.","solutions":["Inspect the Cargo.toml the CLI resolved and restore it to a normal Cargo mapping (keys plus [sections])","If the file is corrupt, restore it from version control","Recreate the module layout with `spacetime new` if the manifest is unrecoverable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let text = std::fs::read_to_string(&manifest)?;\nlet v: toml::Value = text.parse()?;\nif !v.is_table() {\n    anyhow::bail!(\"{} is not a valid TOML mapping\", manifest.display());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the module Cargo.toml exactly as scaffolded by `spacetime new`","Run `cargo metadata` as a preflight — if Cargo accepts the manifest, the shape is fine","Never hand-write exotic TOML at the root of a module workspace"],"tags":["toml","cargo","spacetime-cli","manifest"],"backgroundTag":"invalid-manifest-format","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}