{"record":{"id":"8d04e20e45ba3b5f","repo":"AprilNEA/OpenLogi","slug":"in-progress-contribution-contains-a-non-utf-8-entry","errorCode":null,"errorMessage":"in-progress contribution contains a non-UTF-8 entry","messagePattern":"in-progress contribution contains a non-UTF-8 entry","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/contribute.rs","lineNumber":295,"sourceCode":"\nfn validate_resumable_layout(directory: &Path, cassettes: &[HidCassette]) -> Result<()> {\n    for entry in\n        fs::read_dir(directory).context(\"could not inspect resumable contribution directory\")?\n    {\n        let entry = entry.context(\"could not inspect resumable contribution entry\")?;\n        let name = entry.file_name();\n        match name.to_str() {\n            Some(STATE_FILE | PROFILE_FILE) => {}\n            Some(MANIFEST_FILE) => require_regular_file(&entry.path(), \"fixture manifest\")?,\n            Some(CASES_DIRECTORY) if !cassettes.is_empty() => {\n                require_directory(&entry.path(), \"fixture cases directory\")?;\n                validate_resumable_cases(&entry.path(), cassettes)?;\n            }\n            Some(other) => bail!(\n                \"in-progress contribution contains unexpected entry {other:?}; refusing to \\\n                 publish over it\"\n            ),\n            None => bail!(\"in-progress contribution contains a non-UTF-8 entry\"),\n        }\n    }\n    Ok(())\n}\n\nfn validate_resumable_cases(directory: &Path, cassettes: &[HidCassette]) -> Result<()> {\n    let expected = cassettes\n        .iter()\n        .map(|cassette| format!(\"{}.json\", cassette.name))\n        .collect::<Vec<_>>();\n    for entry in fs::read_dir(directory).context(\"could not inspect resumable fixture cases\")? {\n        let entry = entry.context(\"could not inspect resumable fixture case\")?;\n        let name = entry.file_name();\n        let Some(name) = name.to_str() else {\n            bail!(\"resumable fixture cases contain a non-UTF-8 entry\");\n        };\n        if !expected.iter().any(|expected| expected == name) {\n            bail!(\"resumable fixture cases contain unexpected file {name:?}\");","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/contribute.rs#L277-L313","documentation":"During the same pre-publish layout audit of the contribution directory, any directory entry whose filename is not valid UTF-8 cannot be matched against the expected entry names (state, profile, manifest, cases). Since the tool cannot classify it, it bails with this message rather than publishing over or silently deleting unknown content. Filenames here are expected to be UTF-8 (they become part of committed fixture data).","triggerScenarios":"Running the publish/finish phase of `openlogi fixture contribute` when the contribution directory contains an entry with non-UTF-8 bytes in its name — typically created by a tool on a platform/filesystem with different encoding conventions, or by a filesystem-corruption event.","commonSituations":"Files created with legacy encodings (e.g. Latin-1 names via Samba/NFS mounts or old archive extraction) inside DIR; mangled names after a failed copy; filesystem corruption; copying the contribution directory through a tool that re-encoded names.","solutions":["Find the offending entry (`find DIR -name '*\\?*'` or `ls -b DIR`) and delete or rename it to valid UTF-8, then rerun.","Recreate the contribution directory with clean UTF-8 content: move expected files out, remove the directory, and rerun the contribute workflow.","Avoid copying contribution directories through non-UTF-8-preserving tools or legacy network shares.","If this recurs without explanation, check the filesystem for corruption (`fsck` on Linux, Disk Utility first aid on macOS)."],"exampleFix":"# before\nls -b fx/  ->  profile.json  state.json  fx\\xff\\xfe/\n# error: non-UTF-8 entry\n\n# after\nrm -rf 'fx/'fx$'\\xff\\xfe'    # or rename it to a UTF-8 name\nopenlogi fixture contribute --output fx ...","handlingStrategy":"validation","validationCode":"fn has_non_utf8_names(dir: &Path) -> anyhow::Result<bool> {\n    Ok(fs::read_dir(dir)?\n        .filter_map(Result::ok)\n        .any(|e| e.file_name().to_str().is_none()))\n}\n// if true, find and rename/remove the offending entry before publishing","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy contribution directories only through UTF-8-preserving tools and filesystems (avoid legacy network shares).","Use `ls -b` to spot non-ASCII byte sequences in filenames before resuming.","Extract archives with tools that preserve or normalize UTF-8 names.","Keep the contribution directory local (e.g. ext4/APFS), not on mounted shares with legacy encoding."],"tags":["cli","filesystem","encoding","contributions"],"backgroundTag":"invalid-identifier-format","analyzedSha":"e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8","analyzedAt":"2026-09-13T03:07:16.451Z","contentChangedAt":"2026-09-13T03:07:16.451Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}