{"record":{"id":"99d96ecdc6cad783","repo":"openai/codex","slug":"git-command-command-produced-non-utf-8-output","errorCode":null,"errorMessage":"git command `{command}` produced non-UTF-8 output","messagePattern":"git command `(.+?)` produced non-UTF-8 output","errorType":"exception","errorClass":"GitToolingError","httpStatus":null,"severity":"error","filePath":"codex-rs/git-utils/src/errors.rs","lineNumber":17,"sourceCode":"use std::path::PathBuf;\nuse std::process::ExitStatus;\nuse std::string::FromUtf8Error;\n\nuse thiserror::Error;\nuse walkdir::Error as WalkdirError;\n\n/// Errors returned while managing git worktree snapshots.\n#[derive(Debug, Error)]\npub enum GitToolingError {\n    #[error(\"git command `{command}` failed with status {status}: {stderr}\")]\n    GitCommand {\n        command: String,\n        status: ExitStatus,\n        stderr: String,\n    },\n    #[error(\"git command `{command}` produced non-UTF-8 output\")]\n    GitOutputUtf8 {\n        command: String,\n        #[source]\n        source: FromUtf8Error,\n    },\n    #[error(\"{path:?} is not a git repository\")]\n    NotAGitRepository { path: PathBuf },\n    #[error(\"path {path:?} must be relative to the repository root\")]\n    NonRelativePath { path: PathBuf },\n    #[error(\"path {path:?} escapes the repository root\")]\n    PathEscapesRepository { path: PathBuf },\n    #[error(\"failed to process path inside worktree\")]\n    PathPrefix(#[from] std::path::StripPrefixError),\n    #[error(transparent)]\n    Walkdir(#[from] WalkdirError),\n    #[error(transparent)]\n    Io(#[from] std::io::Error),\n}","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/git-utils/src/errors.rs#L1-L35","documentation":"GitToolingError::GitOutputUtf8: a git command completed but its stdout/stderr could not be decoded as UTF-8. The FromUtf8Error source identifies the bad bytes; worktree snapshot code requires textual git output, so binary/corrupt output is an error.","triggerScenarios":"Thrown at codex-rs/git-utils/src/errors.rs:17 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add -z (NUL-terminated) or --encoding=UTF-8 flags to the git invocation so output is ASCII/UTF-8 safe","Avoid operating on paths with non-UTF-8 bytes, or quote/escape them","Treat the error as non-fatal and skip the affected entry if the tooling permits"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}