{"record":{"id":"37b00fda78ba9da6","repo":"unicity-aos/aos-ce","slug":"aos-capsule-directory-contains-a-non-utf-8-entry","errorCode":null,"errorMessage":"AOS capsule directory contains a non-UTF-8 entry","messagePattern":"AOS capsule directory contains a non-UTF-8 entry","errorType":"validation","errorClass":"io::Error","httpStatus":null,"severity":"error","filePath":"crates/unicity-aos-bootstrap/src/lib.rs","lineNumber":748,"sourceCode":"            ),\n        ));\n    }\n    let canonical = path.canonicalize()?;\n    let mut actual = Vec::new();\n    for entry in fs::read_dir(&canonical)? {\n        let entry = entry?;\n        let metadata = fs::symlink_metadata(entry.path())?;\n        if metadata.file_type().is_symlink() || !metadata.is_file() {\n            return Err(io::Error::new(\n                io::ErrorKind::InvalidInput,\n                format!(\n                    \"AOS capsule directory contains a non-regular entry: {}\",\n                    entry.path().display()\n                ),\n            ));\n        }\n        let name = entry.file_name().into_string().map_err(|_| {\n            io::Error::new(\n                io::ErrorKind::InvalidInput,\n                \"AOS capsule directory contains a non-UTF-8 entry\",\n            )\n        })?;\n        actual.push(name);\n    }\n    actual.sort();\n    let mut expected = expected.to_vec();\n    expected.sort();\n    if actual != expected {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            format!(\n                \"AOS capsule set differs from Community Edition; expected {}, found {}\",\n                expected.len(),\n                actual.len()\n            ),\n        ));","sourceCodeStart":730,"sourceCodeEnd":766,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/crates/unicity-aos-bootstrap/src/lib.rs#L730-L766","documentation":"Thrown by validate_capsule_dir when a filename inside the capsule directory is not valid UTF-8. Since capsule names are embedded into a TOML manifest and compared as Rust Strings, the library cannot represent non-UTF-8 names and rejects the directory.","triggerScenarios":"A file in the capsule directory has a name with invalid UTF-8 bytes (e.g. created on a filesystem with non-UTF-8 encoding or via raw bytes); entry.file_name().into_string() fails during capsule_dir_with validation.","commonSituations":"Files created by non-UTF-8 locale tooling; filenames with legacy encodings (Latin-1, GBK); corrupted downloads producing odd filenames.","solutions":["Rename the offending file to a valid UTF-8 name (e.g. `convmv -f latin1 -t utf8 -r --notest <dir>`)","Delete files with non-UTF-8 names and re-install capsules via install_capsule_fixtures","Ensure the tooling that creates capsule files runs under a UTF-8 locale"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"fn all_names_utf8(path: &std::path::Path) -> bool {\n    std::fs::read_dir(path).map(|rd| {\n        rd.filter_map(|e| e.ok()).all(|e| e.file_name().into_string().is_ok())\n    }).unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"match bootstrap::capsule_dir_with(&home) {\n    Err(e) if e.to_string().contains(\"non-UTF-8 entry\") => {\n        eprintln!(\"Rename files with non-UTF-8 names in the capsule directory\");\n    }\n    Err(e) => return Err(e),\n    Ok(dir) => dir,\n}","preventionTips":["Run capsule-producing tooling under a UTF-8 locale","Scan the directory for non-UTF-8 names before bootstrap","Never create capsule files from raw-byte filenames"],"tags":["rust","filesystem","utf-8","encoding","capsules"],"backgroundTag":"invalid-identifier-format","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"}