{"record":{"id":"586493fbc6f58845","repo":"AprilNEA/OpenLogi","slug":"fixture-structure-verification-failed-fixture-paths-must-be","errorCode":null,"errorMessage":"fixture structure verification failed: fixture paths must be valid UTF-8","messagePattern":"fixture structure verification failed: fixture paths must be valid UTF-8","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/openlogi-cli/src/cmd/fixture/verify.rs","lineNumber":251,"sourceCode":"}\n\nfn require_regular_file(entry: &DirEntry, asset: &str) -> Result<()> {\n    let metadata = entry_metadata(entry, asset)?;\n    if metadata.file_type().is_symlink() || !metadata.is_file() {\n        bail!(\"fixture structure verification failed: {asset} must be a non-symlink regular file\");\n    }\n    Ok(())\n}\n\nfn entry_metadata(entry: &DirEntry, asset: &str) -> Result<std::fs::Metadata> {\n    fs::symlink_metadata(entry.path()).with_context(|| {\n        format!(\"fixture structure verification failed: could not inspect {asset}\")\n    })\n}\n\nfn entry_name(entry: &DirEntry) -> Result<String> {\n    entry.file_name().into_string().map_err(|_| {\n        anyhow::anyhow!(\"fixture structure verification failed: fixture paths must be valid UTF-8\")\n    })\n}\n\n#[cfg(test)]\nmod tests;\n","sourceCodeStart":233,"sourceCodeEnd":257,"githubUrl":"https://github.com/AprilNEA/OpenLogi/blob/e846e6f4b4405e33bd6a9aaf949a482ce34cb6d8/crates/openlogi-cli/src/cmd/fixture/verify.rs#L233-L257","documentation":"Thrown by `entry_name()` during fixture structure verification when a directory entry's file name cannot be converted from OsString to String (non-UTF-8 bytes). Fixture verification requires all paths under the fixture tree to be valid UTF-8 so they can be treated as schema/asset names. It is wrapped with the 'fixture structure verification failed' prefix used by `inspect`.","triggerScenarios":"`openlogi` fixture verify (via inspect or load_cassettes) walks a fixture directory containing a file or subdirectory whose name contains invalid UTF-8 bytes — common with files created on other filesystems/encodings or by archive extraction.","commonSituations":"Extracting a fixture tarball created with a non-UTF-8 locale; files copied from Windows with legacy codepage names; a stray file dropped into fixtures/ by a tool with raw-byte naming.","solutions":["Find and rename or delete the offending non-UTF-8 file in the fixture directory (e.g. with `find . -name '*\\x*'` or `convmv`)","Re-extract or re-copy the fixtures ensuring a UTF-8 filesystem locale (LANG/LC_ALL=C.UTF-8)","Regenerate the fixture set from the recording tool instead of hand-copying files"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for entry in fs::read_dir(fixtures_dir)? {\n    let entry = entry?;\n    if entry.file_name().to_str().is_none() {\n        anyhow::bail!(\"non-UTF-8 fixture path: {:?}\", entry.file_name());\n    }\n}","typeGuard":"fn valid_utf8_name(entry: &DirEntry) -> Option<&str> {\n    entry.file_name().to_str()\n}","tryCatchPattern":"match verify_fixture_tree(path) {\n    Ok(report) => println!(\"{}\", report),\n    Err(e) if e.to_string().contains(\"valid UTF-8\") => {\n        eprintln!(\"Fixture tree has a non-UTF-8 filename; rename it and retry.\");\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Keep fixture filenames ASCII/UTF-8 only; lint the fixtures dir in CI","Extract fixture archives with a UTF-8 locale (LC_ALL=C.UTF-8)","Use `convmv` or `find -name '*\\x*'` audits after copying fixtures across machines"],"tags":["rust","fixture","filesystem","utf8"],"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"}