{"record":{"id":"bfac5155b1526c6d","repo":"unicity-aos/aos-ce","slug":"embedded-distro-has-no-capsules-migration","errorCode":null,"errorMessage":"embedded distro has no capsules","messagePattern":"embedded distro has no capsules","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/migration.rs","lineNumber":462,"sourceCode":"        if name != OsStr::new(\"default.toml\") {\n            inactive_profiles.push(PathBuf::from(\"etc/profiles\").join(name));\n        }\n    }\n    for relative in inactive_profiles {\n        archive_path(staging, &relative, entries)?;\n    }\n    Ok(())\n}\n\nfn unicity_ce_capsule_names() -> io::Result<HashSet<String>> {\n    let manifest = crate::UNICITY_CE_MANIFEST\n        .parse::<toml::Value>()\n        .map_err(|error| io::Error::new(io::ErrorKind::InvalidData, error))?;\n    let capsules = manifest\n        .get(\"capsule\")\n        .and_then(toml::Value::as_array)\n        .ok_or_else(|| {\n            io::Error::new(\n                io::ErrorKind::InvalidData,\n                \"embedded distro has no capsules\",\n            )\n        })?;\n    capsules\n        .iter()\n        .map(|capsule| {\n            capsule\n                .get(\"name\")\n                .and_then(toml::Value::as_str)\n                .map(str::to_owned)\n                .ok_or_else(|| {\n                    io::Error::new(io::ErrorKind::InvalidData, \"embedded capsule has no name\")\n                })\n        })\n        .collect()\n}\n","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/migration.rs#L444-L480","documentation":"unicity_ce_capsule_names parses the embedded distribution manifest as TOML and requires a top-level `capsule` array. If the manifest is present but has no `capsule` key (or it is not an array), the function maps that to an InvalidData io::Error with this message. It signals that the bundled distro manifest is structurally invalid for migration.","triggerScenarios":"Calling archive_inactive_activation_state (which calls unicity_ce_capsule_names) against a bootstrap distro whose embedded manifest TOML lacks a `[capsule]` array, or defines `capsule` as a table/string instead of an array of tables.","commonSituations":"A distro image built from an older manifest schema before the `capsule` section was introduced; a hand-edited or truncated embedded manifest; packaging tooling stripping the section during build.","solutions":["Rebuild the bootstrap distro so its embedded manifest includes a `capsule` array of tables","Inspect the embedded manifest with `toml` tooling to confirm the `capsule` key exists and is an array","Verify the packaging pipeline is embedding the correct manifest file and not a stub/older version"],"exampleFix":"# before (manifest.toml embedded in distro)\n[meta]\nversion = 1\n\n# after\n[meta]\nversion = 1\n\n[[capsule]]\nname = \"core\"","handlingStrategy":"validation","validationCode":"fn manifest_has_capsules(manifest: &str) -> bool {\n    toml::from_str::<toml::Value>(manifest)\n        .ok()\n        .and_then(|v| v.get(\"capsule\").and_then(|c| c.as_array()).map(|a| !a.is_empty()))\n        .unwrap_or(false)\n}","typeGuard":"fn has_capsule_array(manifest: &toml::Value) -> Option<&Vec<toml::Value>> {\n    manifest.get(\"capsule\").and_then(|c| c.as_array())\n}","tryCatchPattern":"match unicity_ce_capsule_names() {\n    Ok(names) => proceed(names),\n    Err(e) if e.to_string().contains(\"embedded distro has no capsules\") =>\n        eprintln!(\"distro manifest missing capsule section; rebuild distro\"),\n    Err(e) => return Err(e),\n}","preventionTips":["Schema-validate the embedded distro manifest at build time","Add a CI check that every distro manifest contains a non-empty capsule array","Never hand-edit the embedded manifest; regenerate it from the upstream source"],"tags":["rust","toml","config","migration"],"backgroundTag":"missing-required-config-field","analyzedSha":"f6f22024fb1e8d122f28a1b4a9f75aee448ae839","analyzedAt":"2026-09-13T03:04:44.565Z","contentChangedAt":"2026-09-13T03:04:44.565Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}